From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: PATCH: [key]=value syntax, work in progress
Date: Wed, 13 Sep 2017 00:13:35 -0700 [thread overview]
Message-ID: <CAH+w=7bTW6Gjiq0mhnQUe9FAXaPjLD=NZqqRmZkiLS2CcxnLYQ@mail.gmail.com> (raw)
In-Reply-To: <20170912212519.3d873212@ntlworld.com>
On Tue, Sep 12, 2017 at 1:25 PM, Peter Stephenson
<p.w.stephenson@ntlworld.com> 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?
next prev parent reply other threads:[~2017-09-13 7:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 20:51 Peter Stephenson
2017-09-11 20:56 ` Peter Stephenson
2017-09-12 20:25 ` Peter Stephenson
2017-09-12 20:28 ` Peter Stephenson
2017-09-13 7:13 ` Bart Schaefer [this message]
2017-09-13 8:53 ` Peter Stephenson
2017-09-13 16:44 ` Bart Schaefer
2017-09-14 20:48 ` Peter Stephenson
2017-09-19 1:13 ` Bart Schaefer
2017-09-13 9:14 ` Oliver Kiddle
2017-09-13 19:41 ` Peter Stephenson
2017-09-14 7:03 ` Daniel Shahaf
2017-09-14 20:38 ` Peter Stephenson
2017-09-16 10:30 ` Daniel Shahaf
2017-09-14 6:54 ` 'typeset -p' of assocs (was: Re: PATCH: [key]=value syntax, work in progress) Daniel Shahaf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH+w=7bTW6Gjiq0mhnQUe9FAXaPjLD=NZqqRmZkiLS2CcxnLYQ@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).