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

Problem with associative arrays



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