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

Re: autoload



On 09/21/2015 11:17 AM, Bart Schaefer wrote:
Did you miss the email where I explained how to do that?
On the first pass through a subject like this there is so much to learn
and so much error and misunderstanding and diversions and distractions
that one is lucky to come out of it alive.  On the second pass things will
gel.

Really think about "because the language is interpreted."
Deep lessons ...

I can make up an infinite number of increasingly convoluted cases to
break any "simple, elegant" automation.  So unless you happen to have
"zmodload zsh/artificial-intellgence" lying around ready for use, I'm
done with this discussion.

I'd just expect the precompiled function to behave exactly as a sourced function would behave, all that's different is that the file being parsed is ... is this where I go off the rails? ... what I'd call 'object code' which is to say that it's somewhat pre-digested as far as the interpreter goes. But when it is actually called (as if it were sourced) it would behave exactly identically to a normal sourced function.
It's just parsed quicker.  Very different from C, as you say.

I dunno, if I have a function ' test () { echo $PWD } ' I'm not expecting $PWD to be hard captured at sourcing time, is there even a way to do that? It might be cool if there was a way, but surely that's rather unusual. So, on the contrary,
I'm thinking not of artificial-intelligence but rather of something
dumb as a donkey.  Autoloaded functions at present seem to behave as I'd
expect, so I don't know where the problem arises.  Your 'evaluate once'
scenario is valid of course, but I have no idea how that would be handled even
by a regular function.  It seems a separate issue to me.

To be honest, your stamina sticking with this so long has already astonished me,
so if you're done, that's overdue, but thanks.



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