Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Inconsistencies in "-quoting and @-splitting, could someone elaborate?
- X-seq: zsh-workers 43735
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: dana <dana@xxxxxxx>
- Subject: Re: Inconsistencies in "-quoting and @-splitting, could someone elaborate?
- Date: Sun, 28 Oct 2018 12:54:15 +0100
- Cc: Zsh hackers list <zsh-workers@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=lV6UoJkOTOkpYklsR1i9jPnAfaO2ygA9p9qkc0Y4jok=; b=prGVDz2rX7Dme0Lsx+9T2+P4a1YyqCoVPPEnpEXRDoo/n+AVfBzwG9dTzP20ItXSUR iioRGNbT7svE1POd828wi8QmDokvKUg0i+HRQHkvE1zfvtm9lUVjcKzMLXViW6A6nGaZ u1EAdvyxKSA/ARRus+PVM6m46dcf0twDNr29ovs0o8FWUx8UKxqYO1mpJooALfnlIBMo uc4FI0QZGj6RhStPGs8VddfyQPNncIGO53kcT6cnohTYf7nY0KRK1+RxjU6QCFEn6puQ X9VuuOayr3TUWkP76vX5jscRtZBYVs2dNmE2e+nq9TfOE5VEFiwqFqeDdzLap5mfINCo zPGw==
- In-reply-to: <1BE52C46-161F-412B-A539-4B0EA87A2FCE@dana.is>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCdqYwOrYr5-7bzduNsJd9OAUz0B-68jg_D5MqMUiVnKw@mail.gmail.com> <1BE52C46-161F-412B-A539-4B0EA87A2FCE@dana.is>
On Sun, 28 Oct 2018 at 02:34, dana <dana@xxxxxxx> wrote:
> >accidentally-similar, with possible further differences, exceptions,
> >so I would state there's a major inconsistency/historically-driven
> >problem in Zsh. Are there other such flags in Zsh?
>
> I don't understand where the inconsistency is...? Are you just speculating that
> there might be one?
@ is refered to as "@ -- double-quoted splitting of scalars" in
completion. I understand it as: for quoted expression, regenerate
array-form by doing splitting. So "$array" is a single string
containing the whole array contents (if not ksharrays, where it would
have only 1st element), while "${(@)array}" is still an array, because
theoretically, like the completion says, the "-induced string is split
to again become an array.
So one can obtain always-array behavior with @. This flag doesn't help
(s::) and (z) when the result is string. I feel this is inconsistent,
I should be able to "split" the resulting string into an array, like
it would happen here with @ and array:
% array=( "foo" )
% print "${#${(@)array}}"
1
Despite array is single element, @ splits it into array type. (s::)
and (z) behave differently for single-element result, that is one
(maybe subjective) inconsistency, and for the second – @ doesn't help
(ie. (z@) still doesn't return as an array), that's second
inconsistency IMO.
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author