Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zcompile does not expand aliases defined in the compiled script
- X-seq: zsh-workers 46214
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: zcompile does not expand aliases defined in the compiled script
- Date: Wed, 8 Jul 2020 07:18:53 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- In-reply-to: <CAHYJk3TZdYB9zmGjiazyfgrQo=D8i9wVC4uuDp1FMJqZ-Bw6XQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAN=4vMrevv626MrDG=yaqJKOjs_6ayQVfiaUBBmj+yHbsn+6cw@mail.gmail.com> <CAHYJk3TZdYB9zmGjiazyfgrQo=D8i9wVC4uuDp1FMJqZ-Bw6XQ@mail.gmail.com>
- Sender: zsh-workers@xxxxxxx
On Tue, Jul 7, 2020 at 10:28 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> It is possible that you changed the example in the mail without trying
> what you changed; if you have the statements
> alias x=:
> x
> in the file x, then sourcing it (non-compiled) will work
Yes, that's exactly it. Given a script like this:
alias x=:
x
Sourcing it without zcompile works (`x` on the second line is
alias-expanded), but once the script is zcompiled an attempt to source
it results in an error (`x` doesn't get expanded).
I looked at the source code of zcompile and I understand why this
happens. It makes perfect sense when zcompiling functions. It is,
however, surprising when zcompiling scripts.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author