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

Re: real time alias?



On 18/03/18 04:01 PM, Bart Schaefer wrote:
On Mar 16, 11:56am, Ray Andrews wrote:
}

Sure, but it doesn't keep track of whether "c" is the ONLY function
that came from that file.  It wouldn't be safe to automatically re-
source just any such file.  Telling zsh which files can be sourced
that way is the job of "autoload".
I sorta see that.  When I tried autoload a while back it was a bit of a disaster because my functions mostly have subsidiary functions in the same file and I wanted them all autoloaded at the same time, which IIRC autoload does not do.  But, given that a file is sourced or not sourced I get a glimmer now of why it better only have one function given what you've just said.  The logical level of the file is relevant to sourcing but not relevant to anything else. And the bureaucracy of trying to keep it all straight would be onerous.

Although it does seem ripe for unintended side-effects.
Yeah, and I guess any user of aliases ( or macros as in C ) knows that, and knows it's their hide if they are not careful.   Anyway 'eval alias' is the exact and intuitive answer to my original, and it's cool that we can have it either way.




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