Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: [key]=value syntax, work in progress
- X-seq: zsh-workers 41692
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: [key]=value syntax, work in progress
- Date: Wed, 13 Sep 2017 00:13:35 -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=jipAcZr70TJEwkOzu4xzgnyePruOyt2aNiVhOFNoBvo=; b=DdgOi/u9+kz7kiR3LuABv3zqcYiohZqyowdCSgkStrQgyXFeWiN4oiJ3g9oGgc4Mnh ELK/T1R7tRrwgCD69MeXbq4ogpaUQkft1Erbzwurg28fx1w9h/3dq9/Y22wSBADN4Yce reD/CyKaqdKVquivCyOWJ4oRKayq8ZupsNVoOTIEwnYnqMHjj1Yy5u6SqcWwOKF1dhEm ekXsrLdXGg774G3keQEVGFnQQZ6NRE89RNDQ3nP7AxPX0t9VcLfDlMz9xFip3AuFlZ41 XJl8oCLF/Sx0ZcwrXuVOodCZb/d0IH0tyiYLXgjGHQSYGyvLD64jwVJNv/d8Xdrgxa6P 8/sw==
- In-reply-to: <20170912212519.3d873212@ntlworld.com>
- 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: <20170911215115.6aa27dec@ntlworld.com> <20170912212519.3d873212@ntlworld.com>
On Tue, Sep 12, 2017 at 1:25 PM, Peter Stephenson
<p.w.stephenson@xxxxxxxxxxxx> wrote:
>
> (I take silence to mean "grmf why are you even bothering to do this
> frmkfplp", with consontantal clusters different by local factors.)
Or just lack of time ...
> If the parameter var(name) exists and is a scalar, it is replaced by a new
> array. To append to an array without changing the existing values, use
> -the syntax:
> +one of the following:
> ifzman()
> indent(var(name)tt(+=LPAR())var(value) ...tt(RPAR()))
> +indent(var(name)tt(+=LPAR())tt([)var(key)tt(]=)var(value) ...tt(RPAR()))
What does "append" mean when the keys are specified? If I have
arr=( 1 2 3 4 5 )
and I do
arr+=( 6 [2]=7 8 )
does that even make sense? That's certainly not "appending" to arr[2].
The other point that this raises is that in ksh "typeset -p" of an associative
array outputs e.g.
typeset -A x=([y]=2 [z]=1)
and that's the only way to assign an associative array; if you assign without
the [k]=v syntax the parameter converts into an ordinary array. Is this going
to get enforced when KSH_ARRAYS and/or KSH_TYPESET are in effect?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author