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

RE: Zsh Guide chapter 5 (substitutions)



> 
> I don't know if anyone has already pointed this out, but in the user
guide
> section 5.4.2:
> 
>   perl                          zsh
>   -----------------------------------------------------------------
>   %hash2 = %hash;               typeset -A hash2; hash2=(${(kv)hash})
> 
> Surely this should be hash2=("${(@kv)hash}") in case of empty string
> values.
> 


No (at least, if running as zsh):

bor@itsrm2% foo=(a "a a" b "b b")
bor@itsrm2% print -l $foo
a a
b b
bor@itsrm2% typeset -A bar
bor@itsrm2% bar=(${(kv)foo})
bor@itsrm2% print -l $bar   
a a
b b

-andrej



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