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

Re: [key]+=val



On Mon, Sep 25, 2017 at 3:35 AM, Peter Stephenson
<p.stephenson@xxxxxxxxxxx> wrote:
>
> foo=([key]+=val)
>
> doesn't (just creates the value), because you're starting with an empty
> set of values in foo so there's nothing to append to.  Does this sound
> reasonable?  It's a messy layering violation otherwise so it would need
> a good reason to do it differently.

Ksh says:

$ typeset -A foo
$ foo=([samekey]+=val [samekey]+=ue [samekey]+=grows)
$ typeset -p foo
typeset -A foo=([samekey]=valuegrows)



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