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

Re: Source mangling in $functions_source and typeset -f



On 2021-11-27 9:47 a.m., Bart Schaefer wrote:

With the exception of the contents of strings (including
here-documents), the original source of a function is not kept in
shell memory.  Instead a parse tree is stored and used to regenerate
the function definition by "typeset -f" et al.
That's most interesting, it seems circular so there must be a good reason for it, but why take the source as written, then parse it down to 'clean code' and then construct whatever internal representations zsh uses and then reconstruct clean code from that when one could just repeat the first step?  Is it perhaps faster to perform the 3d step than repeat the first step?  But repeating the first step would surely preserve more?






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