Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Disabling null elision (was: Re: Most Recent File)
- X-seq: zsh-users 27290
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Subject: Re: Disabling null elision (was: Re: Most Recent File)
- Date: Mon, 25 Oct 2021 13:05:22 -0700
- Archived-at: <https://zsh.org/users/27290>
- In-reply-to: <20211025194508.GB8612@tarpaulin.shahaf.local2>
- 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> <20211025194508.GB8612@tarpaulin.shahaf.local2>
On Mon, Oct 25, 2021 at 12:45 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> 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}
Note there isn't a ${(=)name}, it's just $=name or ${=name}.
> On the one hand, null elision breaks the principle of least surprise
This is another one of those where it depends on who is being surprised.
A person coming from csh would not be surprised by null-elision and in
fact would be surprised by the opposite.
> 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
If we ignore the global option and focus on expansion flags, this
becomes much less problematic; we could add a flag with this semantic
... but if you're going to need a flag, you might as well need double
quotes as well.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author