zsh-workers
 help / color / mirror / code / Atom feed
* get keys of an associative array?
@ 2017-03-26 19:18 Jens Elkner
  2017-03-26 19:34 ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Elkner @ 2017-03-26 19:18 UTC (permalink / raw)
  To: zsh-workers

Hi,

I've KSH_ARRAYS (beside KSH_GLOB KSH_TYPESET KSH_OPTION_PRINT) set,
however, getting the key set of an array via ${!vname[@]} (as usually
done within ksh or bash) does not work (bad substitution). Couldn't find
anything else, except the @k flag, but this doesn't work as well, e.g.

unset A; typeset -A A; A['a']=1; A['b']=2; A['c']=3 ; print "${(@k)A}"

should print 'a b c' but prints '3'. Bug, feature? Hmmm, any hints?

Thanx,
jel.
-- 
Otto-von-Guericke University     http://www.cs.uni-magdeburg.de/
Department of Computer Science   Geb. 29 R 027, Universitaetsplatz 2
39106 Magdeburg, Germany         Tel: +49 391 67 52768


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

end of thread, other threads:[~2017-03-27  8:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-26 19:18 get keys of an associative array? Jens Elkner
2017-03-26 19:34 ` Peter Stephenson
2017-03-26 20:03   ` Bart Schaefer
2017-03-26 22:06     ` Jens Elkner
2017-03-27  8:36       ` Peter Stephenson
2017-03-26 21:55   ` Jens Elkner

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).