zsh-workers
 help / color / mirror / code / Atom feed
* Spaces in associative array keys
@ 1998-11-13 18:01 Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 1998-11-13 18:01 UTC (permalink / raw)
  To: zsh-workers

zagzig<1> typeset -A foo
zagzig<2> foo[bar]=fred
zagzig<3> foo[7]="the winter of our discontent"
zagzig<4> foo[$foo[7]]=shakespeare
zsh: bad math expression: unbalanced stack
zagzig<5> print -l "$foo[@]"
shakespeare
the winter of our discontent
fred
zagzig<6> print -l "${(k)foo[@]}"
the winter of our discontent
7
bar

The only way I could get zsh to accept spaces in the [ ] was to use a
variable reference, and then I get the "unbalanced stack" error on the
first reference, even though it does work thereafter.

Gotta go now, perhaps more on this over the weekend.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-11-13 18:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-13 18:01 Spaces in associative array keys Bart Schaefer

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