From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18747 invoked by alias); 13 Sep 2017 07:13:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41692 Received: (qmail 15232 invoked by uid 1010); 13 Sep 2017 07:13:45 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f171.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.216.171):SA:0(-1.4/5.0):. Processed in 3.333546 secs); 13 Sep 2017 07:13:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM,SPF_PASS, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=jipAcZr70TJEwkOzu4xzgnyePruOyt2aNiVhOFNoBvo=; b=a1RWvpsjTWjIu04X+JQsEoNmMBCw/8qrbC0O5CR/mB6FhnVCLOnm4nFSh3AZouF2ed Hbzwge9oxHFJZLQQnO6d9Fv2KbsTK6R1S5W+WhFQpOeVkEzBVE+MDneqRPWefgvy+4gN waEaeEGCI0pDQBVfoSotcNgtTyfwY4Ii/KafNlyBTasWbasxcnWqfUudjS28GyJvJBFR 7Y19oT4UbFVCj6t1tFD/G5xpSGvdyLe9C2TGXnpumRYKTSb7maSUx+e5DkpTbWsjGbyp Y3/6ed0ctYj3HG9AZUqEs+A5ZvbY9mJ1VPpm+SfgmLoypIXE0I3B8f2Sf5SGf+tcKas0 NMxw== X-Gm-Message-State: AHPjjUhG44Yej/271ebH2RxeXCgSZnSSZcljUzYke4Ql+sKOee+JS9Ra zCIL9F0LPe+It5ZImVIR98gElgiWurpEAccqlFrxhPaD X-Google-Smtp-Source: AOwi7QD6R6Lve+Rm7hZBhtx/o7LsLxFCtPytPks68FoG0AtSK9hB+JgYqTm/DY/zrAvCfJFk0ydCgN4rFpu21CLpSWk= X-Received: by 10.237.37.231 with SMTP id y36mr25199414qtc.199.1505286815887; Wed, 13 Sep 2017 00:13:35 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20170912212519.3d873212@ntlworld.com> References: <20170911215115.6aa27dec@ntlworld.com> <20170912212519.3d873212@ntlworld.com> From: Bart Schaefer Date: Wed, 13 Sep 2017 00:13:35 -0700 Message-ID: Subject: Re: PATCH: [key]=value syntax, work in progress To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Tue, Sep 12, 2017 at 1:25 PM, Peter Stephenson 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?