Sorry I meant to reply to that thread but ran out of time. I think Stephane's
eventual proposal was pretty close to what I had in mind but expressed badly.
I'm not sure why it was eventually decided to deprecate the current system
entirely but I'm not opposed to the idea - especially if it provides no
functionality for which there aren't easy workarounds.
The only thing I'm actively abusing this for at the moment in scripts I
actually use is as a way of encoding 2D arrays. It's very much a read-only
datastructure too.
~ $ ( key1=foo key2=bar; declare -A a=([foo]='([bar]=baz)') "b=${a[$key1]}"
typeset -p a b; echo "${b[$key2]}" )
declare -A a='([foo]="([bar]=baz)" )'
declare -A b='([bar]="baz" )'
baz
Any change will likely break this property but I think wrapping it in eval
gives the same result.
--
Dan Douglas