Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
What's the reasoning behind z & s returning nular for empty input?
- X-seq: zsh-users 24410
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: What's the reasoning behind z & s returning nular for empty input?
- Date: Sat, 9 Nov 2019 08:26:30 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=FL+rKD3uNxybun/8r93EPSQX2nKTg8pQRqyh2XXyE1M=; b=pIfozCiKybSamxNMOrIWjXBrjsN9EWBoxO2B39vfxDif++QkUbQJ+M4ALxA59K8hlu PCEdGCih5vb+ly0nemrE2jKPwvhim9SSHAFgd9oCdb2sBKAFkRpv1uyhLukzZRMwtEH9 LZR8Z4knjSL77QSEmtVL6AI8GgIflnzcdRzzNbTVRMRtM/PgcOOO4qHg4Qn9TH3XLhH+ 5QFE4HbI2ukZXqLdcGNSeqw8eNkXdhljxC1nL51sTl/MBygcuBzFXCF9dWn+K86pvvh8 goFRgA96nyRTYxKz3lOqtpwk5MUJwarySTDvs/exP0LNBeZxaslZfSlM6hBNcB8XZLSf X9fg==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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