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

Re: PATCH: 3.1.5 - sample associative array implementation



On Nov 12,  7:04pm, Timothy Writer wrote:
> Subject: Re: PATCH: 3.1.5 - sample associative array implementation
[Referring to ksh93]
> 
>     typeset -A foo
>     foo[bar]=baz
>     echo ${!foo}
> 
> just prints "foo".  Makes sense because foo is not a nameref.

That's not what I would have expected; I would have expected it to either
(a) behave the same as ${foo} [which means what, when foo is an associative
array?] or (b) print nothing, because there's no variable to which the value
of foo can possibly refer.  Printing its own *name* like that isn't sensible
to me.



Messages sorted by: Reverse Date, Date, Thread, Author