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

patterns in subscripts



> 
> Yes, I know. I wanted to avoid introducing an extra parameter just for 
> the pattern.
> 


there is something fishy.

bor@itsrm2% typeset -A foo
bor@itsrm2% foo[bar]=baz
bor@itsrm2% foo[bar1]=baz1
bor@itsrm2% print ${foo[(I)*]}
bar1 bar
bor@itsrm2% print ${foo[(I)bar*]}
bar1 bar
bor@itsrm2% print ${foo[(I)bar*~bar?]}
bar
bor@itsrm2% print ${foo[(I)bar?#]}
bar1 bar
bor@itsrm2% print ${foo[(I)bar?##]}
BUG: ?# did not get optimized to *
BUG: ?# did not get optimized to *

bor@itsrm2% foo[bar\]]=baz\]       
zsh: not an identifier: foo[bar\]]
bor@itsrm2% foo[bar\\]]=baz\] 
zsh: command not found: foo[bar\]]=baz]
bor@itsrm2% foo[bar\\\]]=baz\]
zsh: not an identifier: foo[bar\\\]]

Must key always be identifier?

-andrej



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