Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Disabling null elision (was: Re: Most Recent File)
- X-seq: zsh-users 27288
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Cc: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Subject: Disabling null elision (was: Re: Most Recent File)
- Date: Mon, 25 Oct 2021 19:45:08 +0000
- Archived-at: <https://zsh.org/users/27288>
- In-reply-to: <CAN=4vMrfKTP6UAAEA=A6WFWP6_0CuRJtEorDK+NcGLd4mkuEow@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAP+y1xC3Dx74sBaCf8mgmEcOMh+hUH6zAdt236k=JTjw4-cBqQ@mail.gmail.com> <CF77Q0TPEKI8.1NCL83P9Z0HV3@kbvv> <YXS6sdovNFVnDAmr@gmx.de> <CAN=4vMrfKTP6UAAEA=A6WFWP6_0CuRJtEorDK+NcGLd4mkuEow@mail.gmail.com>
Roman Perepelitsa wrote on Sun, Oct 24, 2021 at 09:22:46 +0200:
> > It's one of the nice things about zsh that you can use the shorter
> $foo and $#foo instead of "${foo[@]}" and ${#foo[@]}. I wish there was
> an option to disable null elision with a corresponding expansion flag
> to turn it on similar to no_sh_word_split and ${(=)name}
I'm in two minds about this.
On the one hand, null elision breaks the principle of least surprise —
both in reference to other programming languages, and in reference to
SH_WORD_SPLIT's default behaviour being the unlike-Bourne-shell
behaviour.
On the other hand, making it on by default would be backwards
incompatible, and making it off by default would mean there's yet
another syntax-changing option for everyone to keep in mind when they
review random autoloaded functions' code.
All in all, perhaps this is a change to keep in mind for 6.0 (deferring
it to a major version due to the incompatibility).
Thoughts?
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author