Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
associative arrays: k flag in subscripts
- X-seq: zsh-workers 25363
- From: Julius Plenz <julius@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: associative arrays: k flag in subscripts
- Date: Thu, 31 Jul 2008 15:24:52 +0200
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Hi!
Consider this example (executed in a zsh without any configuration
done):
zsh> local -A a
zsh> a=('[0-9]' digit '[0-9a-z]' alnum)
zsh> print $a[(k)3]
digit alnum
zsh> print $a[(K)3]
digit alnum
Actually, I expected the output "digit alnum" when I specified the K
flag. But the k flag should behave differently, according to the
manual: ``... and returns the value for the first key found where
exp is matched by the key.''
So the expression $a[(k)3] should expand to either "digit" or "alnum",
not to both -- right?
Julius
Messages sorted by:
Reverse Date,
Date,
Thread,
Author