Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Defining function based on alias



On Jan 8,  7:19pm, Peter Stephenson wrote:
}
} I am about to commit the following, which I hope will hope will stop
} people coming to grief with this common confusion.  Please say if you
} see any problems.

OK, here's an unusual case ...

    alias safely:foo='[[ -n $functions[foo] ]] || foo'

    safely:foo() { echo this is foo only if no other foo }

I hesitate to suggest further convolutions, but maybe an option to the
alias command to "locally" switch on ALIAS_FUNC_DEF if it's actually
*meant* to be used that way?

Probably not very important.



Messages sorted by: Reverse Date, Date, Thread, Author