Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [key]+=val
- X-seq: zsh-workers 41763
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "Zsh Hackers' List" <zsh-workers@xxxxxxx>
- Subject: Re: [key]+=val
- Date: Mon, 25 Sep 2017 10:53:25 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=c5yONLPjSsHpHlVtmnrAzubl3YSrgFnTDiCe584l9GA=; b=dF8nTs3lQmFFqZrv7YmnnJe9Y787Jl/91FY+taUOHWUWK5/yBsIOxZYRF5ygUvTGlU 2x/WGHXJpq28OMFY2/iCqAE9b1s+TnH9x8qX6Mpen9w54cWEmlXxpv5iQMLSbZmn1cb7 LKCXsiHdOga9UkWL+rObPA4kEyn5msoF2gkTChnFyacbm5SY7qVIJD0dgKxivOE1nmQ4 rlugklX+MAsWC6RAf1/rQzxv1A6o66DL4hBc/Jn3N8TDWkcKwwp1p95/uo4FekOtZY53 9XcWsSq5ckkuhbTt1qKGT9yEs5diSP7yCufAZ3o4Os5dzbbk9UVJKVI/PQwl9wZ8x//w m43Q==
- In-reply-to: <20170925113509.25c2703e@pwslap01u.europe.root.pri>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20170925103513eucas1p2b7d91180ccc6defe455daca9248ae222@eucas1p2.samsung.com> <20170925113509.25c2703e@pwslap01u.europe.root.pri>
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