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 24416
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: What's the reasoning behind z & s returning nular for empty input?
- Date: Sat, 9 Nov 2019 09:52:27 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=QvlbdKviald3V3pA6VhunH7P+MGZrspZQjOcpXFp6Ig=; b=YQDkBYn76AsHuiU+/cdNIcOfvMCsPBj/0zqEwj3EgoSGQgwolR0MxqH5TsHHFW4d1g kzTzGGgPV8yXaC4luyt4RawKIeayLa20cXZ2imkxzsSqmpUIsOgUpPmus2Bz0jXFMHmZ B2wAgkR6T3vq7BnI8UJKkKpMPTEv3PyjFqdd29Zk5hNBvjlYQuT2B/bJpcvQ3tHTlLy8 Cx3L92vqOB7siP7ldgzBeJ5s4ykFr4QmHZrzg9k7h8U/RmBBrXpr94Msj/BjmAPHCZTn Y5TkyDjkJ7PFsnZf2VGb2RWsAjZI72Du8g9TtuSoQ9wHKh4o/Dykg/QWQ1loZXzoe4WB aOXg==
- In-reply-to: <CAKc7PVBi-9aS18pTN7t7iYz2F6Voj8hTu9bDB5NAHSSquwCwew@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> <CAN=4vMpOPy_kecd_EweP7OL5RJUpBNbfAcJUtYxbHPZZq0UV-g@mail.gmail.com> <CAKc7PVBi-9aS18pTN7t7iYz2F6Voj8hTu9bDB5NAHSSquwCwew@mail.gmail.com>
On Sat, Nov 9, 2019 at 9:40 AM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> On Sat, 9 Nov 2019 at 09:22, Roman Perepelitsa
> <roman.perepelitsa@xxxxxxxxx> 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:
>
> Yes, I was also referring to this fragment, however it states that the
> empty elements should be removed, and even – that they should be
> removed more eagerly, so I still wonder why produce a nular for an
> empty input?
Oh, I see what you mean. Apparently, only inner empty elements are
dropped by "${(s...)...}" while the first and the last are retained.
"${(s:,:):-a,,b}" => (a b)
"${(s:,:):-,,}" => ('' '')
Looks like it's either a bug in the code or in the documentation.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author