Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Inconsistencies in "-quoting and @-splitting, could someone elaborate?



On 27 Oct 2018, at 05:33, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
>I'm having problem in grasping, is this behavior:
>- "X-flag creates array, unless its result is a single element", and
>- "X-flag creates array even when double quoted without use of @"

I don't know if it's accurate to say that they 'create an array' — they expand
to a list of zero, one, or multiple words (or elements, or arguments, or
whatever you want to call them), which you might then *put into* or (in certain
parameter-expansion cases) *act on as* an array, but the result of the expansion
is not an array per se.

(Maybe that's arguable when it comes to (A), given how it's implemented, but i
find it useful to think of it that way even in that case.)

On 27 Oct 2018, at 05:33, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
>is this behavior consistent, or per-flag, or general
>random/historical.. Because the two behaviors seem to apply for (s::)
>and (z) (a='a b c d'; print -rl "${(z)a}" will print 4 lines, despite
>"-quoting and lack of @), but they look like a two unrelated,
>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?

dana



Messages sorted by: Reverse Date, Date, Thread, Author