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

What's the reasoning behind z & s returning nular for empty input?



Hi
arr=( "${(s:,:):-}" )
print -r ${#arr} ${(q)arr}
Output: 1 ''

arr=( "${(z):-}" )
print -r ${#arr} ${(q)arr}
Output: 1 ''

I guess the code is returning the nular (or something similar, as
nular is not defined in subst.c). I wonder why? Is the reason
historical? I always have to add exceptions to the code, especially
for (z). Maybe I'm not seeing some reason for this behavior?

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