Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: What's the reasoning behind z & s returning nular for empty input?
- X-seq: zsh-users 24418
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-users@xxxxxxx>
- Subject: Re: What's the reasoning behind z & s returning nular for empty input?
- Date: Sat, 9 Nov 2019 14:33:22 +0000
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20191109143324euoutp01f086172737e56f1f452a835f2c0f83a3~VhR0P74f91986619866euoutp015
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1573310004; bh=0qsYx62kmbuM7c5Ro7NZpS6jAx6KpzOFTtTq6m0J/uw=; h=Subject:From:To:Date:In-Reply-To:References:From; b=d7iDa9ho8WhXd1He01HZ5+HZ3TV0zQrjvdA1sj2618nCmn4LJ13xAaLN1RjBOiJTf V+Ws7aPCtcEYFRwbbSVtsYUgu9RCgbVSTijr/o2QZEFpMeGQZ3AVq2moM6CyqvGpxq ZR10qak/6Xs61hU7AuhUQfhdncgfztmqLg2pNZ/M=
- In-reply-to: <CAN=4vMpOPy_kecd_EweP7OL5RJUpBNbfAcJUtYxbHPZZq0UV-g@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCD7e=vATDBc7px1d4XNYiKu1=2iZP9YaJ5PutgsDTsoQ@mail.gmail.com> <CAN=4vMpj91iZzOgLNNcUzb4UuTDEAiFxkjyuAa76hqqaQjnFBg@mail.gmail.com> <CAKc7PVCArzvg+Tmqwo7xQwYjBSz8sEnJwYPjZ=T0BETHsYsjXQ@mail.gmail.com> <CGME20191109082351eucas1p1f0521a2e62a87f60500c98414255c132@eucas1p1.samsung.com> <CAN=4vMpOPy_kecd_EweP7OL5RJUpBNbfAcJUtYxbHPZZq0UV-g@mail.gmail.com>
On Sat, 2019-11-09 at 09:22 +0100, Roman Perepelitsa wrote:
> On Sat, Nov 9, 2019 at 9:11 AM Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> wrote:
> >
> > Thanks for the analysis. The additional problem is that quoted but
> > @-lacking s-flag should still elide the empty elements, as the manual
> > states. So this is an intentional exception and I wonder why it has
> > been added?
> Here's the passage from zshexpn:
>
> For historical reasons, the usual behaviour that empty array
> elements are retained inside double quotes is disabled for arrays
> generated by splitting; hence the following:
>
> line="one::three"
> print -l "${(s.:.)line}"
>
> produces two lines of output for one and three and elides the
> empty field. To override this behaviour, supply the ‘(@)’ flag as
> well, i.e. "${(@s.:.)line}".
>
> The phrase "for history reasons" is used to describe past design
> decisions and/or implementations that would be different if the
> benefit of hindsight were available at the time, but changing which is
> infeasible due to the existing code relying on the current behavior.
> In other words, the current behavior is unfortunate but cannot be
> changed.
This doesn't really help, but this would certainly be one of the first
"features" out of the window if we were starting from scratch...
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author