zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: Zsh Users <zsh-users@zsh.org>,
	Roman Perepelitsa <roman.perepelitsa@gmail.com>
Subject: Re: Disabling null elision (was: Re: Most Recent File)
Date: Mon, 25 Oct 2021 13:05:22 -0700	[thread overview]
Message-ID: <CAH+w=7YzrKC2fTDxP6VoSuPPgZFSzkSyU=dmNHnau94YWeGmxg@mail.gmail.com> (raw)
In-Reply-To: <20211025194508.GB8612@tarpaulin.shahaf.local2>

On Mon, Oct 25, 2021 at 12:45 PM Daniel Shahaf <d.s@daniel.shahaf.name> 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.


  parent reply	other threads:[~2021-10-25 20:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-23 16:15 Most Recent File Vin Shelton
2021-10-23 16:43 ` Dominik Vogt
2021-10-23 16:58   ` Peter Stephenson
2021-10-23 17:24     ` Dominik Vogt
2021-10-23 17:32       ` Peter Stephenson
2021-10-23 18:39         ` Bart Schaefer
2021-10-23 19:07         ` Vin Shelton
2021-10-23 19:26           ` Bart Schaefer
2021-10-23 20:43             ` Vin Shelton
2021-10-23 20:56               ` Pier Paolo Grassi
2021-10-23 22:42                 ` Bart Schaefer
2021-10-24  0:24                   ` Pier Paolo Grassi
2021-10-24  0:32                     ` Paul
2021-10-24  1:45                       ` Dominik Vogt
2021-10-24  7:22                         ` Roman Perepelitsa
2021-10-25 19:45                           ` Disabling null elision (was: Re: Most Recent File) Daniel Shahaf
2021-10-25 20:02                             ` Roman Perepelitsa
2021-10-25 20:41                               ` Daniel Shahaf
2021-10-25 21:00                                 ` Ray Andrews
2021-10-25 21:09                                   ` Bart Schaefer
2021-10-25 21:05                                 ` Bart Schaefer
2021-10-25 21:20                                 ` Roman Perepelitsa
2021-10-25 20:05                             ` Bart Schaefer [this message]
2021-10-24  1:37                     ` Most Recent File Dominik Vogt
2021-10-23 16:47 ` david rayner
2021-10-23 16:54   ` Vin Shelton
2021-10-23 16:51 ` david rayner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7YzrKC2fTDxP6VoSuPPgZFSzkSyU=dmNHnau94YWeGmxg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=d.s@daniel.shahaf.name \
    --cc=roman.perepelitsa@gmail.com \
    --cc=zsh-users@zsh.org \
    --subject='Re: Disabling null elision (was: Re: Most Recent File)' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).