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

Re: Help with associative arrays



2016-08-21 17:18:11 -0400, Lawrence Velázquez:
[...]
>         The second difference is that a double-quote (`"') may appear as
>         part of a subscript expression without being preceded by
>         a backslash....
[...]

An annoying consequence is that (contrary to with ksh93) you can't do:

a[""]=foo

To assign an element for the empty key. You have to do things
like:

a[${}]=foo

or

a+=('' foo)

instead.

It would be nice if one could do:

a[]=foo

(which currently returns an error)

Note that it's a lot worse in bash. bash associative arrays
can't have an element with an empty key!

-- 
Stephane



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