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

Re: autoload



On 09/20/2015 09:18 PM, Bart Schaefer wrote:
Except for the point that "just sourcing" doesn't actually call the
function, everything you wrote is what DOES happen as long as the
functions are defined in separate files.  Because the language is
interpreted, the shell itself can't decompose a file into individual
function entry points the way e.g. a linker can for a shared object.
Really? That's hard to fathom. I source a file and it finds whatever functions may be in there, but they can't be packed into a .zwc file without worrying about it's name? I'll take that on authority, but it blows my breakers. I'd have thought it
would be as transparent as:

    for aa in /aWorking/Zsh/Source/*; do source $aa; done

... becoming:

zcompile --do_it /not-the-same-directory-dummy\!/Source.zwc /aWorking/Zsh/Source/*

... but if you say that's not even doable I can't argue.
} You know Bart, with all the time you've spent on this, you could have
} written that HOWTO ;-)

The problem is, I wouldn't have known what to write.

Yeah, the paradox of the expert. Experts don't know what they know. The best writer is the guy who just learned it so he remembers what he needed to learn,
where he went wrong, what was important, what was distraction.  Then the
expert edits it for factuality.  Once four or five learners have added their
lessons to the doc, it becomes really usable for the next guy. Like the best
wikis.  The less of an expert you are, the better judge you are as to the
usefulness of a doc.



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