Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Problem with associative arrays
- X-seq: zsh-workers 4770
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx
- Subject: Problem with associative arrays
- Date: Mon, 14 Dec 1998 11:55:24 +0100 (MET)
Hello
Subscripts for associative arrays are matheval()ed which makes some
problems:
% set -A a
% a[foo]=bar
% echo $a[baz]
bar
There is no variable baz, so evaluating it yields zero and since
numeric subscripts on associative arrays work, this yields the `first'
value.
% a[x*]=frob
zsh: bad math expression: unbalanced stack
zsh: bad math expression: unbalanced stack
Yes, `x*' is an invalid math expression, but...
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author