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

Re: Source mangling in $functions_source and typeset -f



On Sat, Nov 27, 2021 at 11:26 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> 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.
> That's most interesting, it seems circular so there must be a good
> reason for it

The parse is stored in a bytecode format (the same one used when
writing a file with zcompile) so:

It's much smaller than the source (usually), and takes up less memory.

It's much closer to being directly executable than the source, and
therefore faster.

Zach's use case is unusual; there's typically not any reason to "preserve more".




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