zsh-users
 help / color / mirror / code / Atom feed
* What's the reasoning behind z & s returning nular for empty input?
@ 2019-11-09  7:26 Sebastian Gniazdowski
  2019-11-09  7:50 ` Roman Perepelitsa
  0 siblings, 1 reply; 9+ messages in thread
From: Sebastian Gniazdowski @ 2019-11-09  7:26 UTC (permalink / raw)
  To: Zsh Users

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-11-10 23:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-09  7:26 What's the reasoning behind z & s returning nular for empty input? Sebastian Gniazdowski
2019-11-09  7:50 ` Roman Perepelitsa
2019-11-09  7:52   ` Roman Perepelitsa
2019-11-09  8:11   ` Sebastian Gniazdowski
2019-11-09  8:22     ` Roman Perepelitsa
2019-11-09  8:40       ` Sebastian Gniazdowski
2019-11-09  8:52         ` Roman Perepelitsa
2019-11-09  9:09           ` Sebastian Gniazdowski
2019-11-09 14:33       ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).