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

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



Hello.
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 @"

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 would add this information to Zsh Native Scripting Handbook. I will
investigate by experimenting and come up with conclusion myself if no
one will help.

Worth noting: the first behavior – no-array for singular result – can
be fixed into consistent (i.e. "always array") behavior by the updated
(A) flag, patch 40640, first appearing in Zsh version 5.4.

-- 
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