From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29476 invoked by alias); 27 Sep 2017 16:22:43 -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: 41773 Received: (qmail 13507 invoked by uid 1010); 27 Sep 2017 16:22:42 -0000 X-Qmail-Scanner-Diagnostics: from mailout1.w1.samsung.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(210.118.77.11):SA:0(-6.9/5.0):. Processed in 2.136216 secs); 27 Sep 2017 16:22:42 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-AuditID: cbfec7f5-f79d06d0000031c7-84-59cbd0495583 Date: Wed, 27 Sep 2017 17:22:30 +0100 From: Peter Stephenson To: Zsh Hackers' List Subject: Re: [key]+=val Message-id: <20170927172230.2d004ff6@pwslap01u.europe.root.pri> In-reply-to: <20170927094236.7a6f593c@pwslap01u.europe.root.pri> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDIsWRmVeSWpSXmKPExsWy7djPc7qeF05HGtx4o2txsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4Mg69OsBacEOi4sXyfewNjDNFuhg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RjFwtIgl9AX+Lq309MEPfZS8y8cgaqWVDix+R7YDXMAloSm7c1sULY8hKb17wFu0FIQF3i xt3d7BMYhWchaZmFpGUWkpYFjMyrGEVSS4tz03OLjfSKE3OLS/PS9ZLzczcxAoN527GfW3Yw dr0LPsQowMGoxMO74ODpSCHWxLLiytxDjBIczEoivL9AQrwpiZVVqUX58UWlOanFhxilOViU xHl796yOFBJITyxJzU5NLUgtgskycXBKNTD2tJjdiU0+8/+xwp1fMdfCS3TP24jvY3R56nvq WYFq38Z6W/cl/z/abpzE1WaZJHJXSvekw1x/CZE9MgmeT9gW3PexFkk+oLbT/wOrQp92/+KP 7s8/GEyb3rf7cL/flvkupg0NEVvbTqyX517I8r7XS3pKtq/X3y9PGOV4WFnDfm7pWHtfdqkS S3FGoqEWc1FxIgA8/WaJYgIAAA== X-CMS-MailID: 20170927162233eucas1p2870b104c5b9f19c0ce9d710e676c5b39 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?UGV0ZXIgU3RlcGhlbnNvbhtTQ1NDLURhdGEgUGxhbmUb?= =?UTF-8?B?7IK87ISx7KCE7J6QG1ByaW5jaXBhbCBFbmdpbmVlciwgU29mdHdhcmU=?= X-Global-Sender: =?UTF-8?B?UGV0ZXIgU3RlcGhlbnNvbhtTQ1NDLURhdGEgUGxhbmUbU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtQcmluY2lwYWwgRW5naW5lZXIsIFNvZnR3YXJl?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDA1Q0QwNTAwNTg=?= CMS-TYPE: 201P X-CMS-RootMailID: 20170925103513eucas1p2b7d91180ccc6defe455daca9248ae222 X-RootMTR: 20170925103513eucas1p2b7d91180ccc6defe455daca9248ae222 References: <20170925113509.25c2703e@pwslap01u.europe.root.pri> <20170926103254.1670a650@pwslap01u.europe.root.pri> <170926102852.ZM14158@torch.brasslantern.com> <20170927094236.7a6f593c@pwslap01u.europe.root.pri> Some tests for normal arrays with KSH_ARRAYS set. diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index d6ed648..5ffaaa1 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -2231,6 +2231,20 @@ F:behavior, see http://austingroupbugs.net/view.php?id=888 >two >three + (setopt KSH_ARRAYS + local keyvalarray + keyvalarray=([0]=one [2]=three) + print -l "${keyvalarray[@]}" + keyvalarray+=([1]=two) + print -l "${keyvalarray[@]}") +0:[key]=val for normal arrays with KSH_ARRAYS +>one +> +>three +>one +>two +>three + typeset -A keyvalhash touch foo Xnot_globbedX key="another key" val="another value" @@ -2258,6 +2272,17 @@ F:behavior, see http://austingroupbugs.net/view.php?id=888 >7 >1 2 3 4 5 6 7 + (setopt KSH_ARRAYS + local keyvalarray + keyvalarray=(1 2 3) + keyvalarray+=([4]=5 [6]=7) + keyvalarray+=([3]=4 [5]=6) + print ${#keyvalarray[*]} + print ${keyvalarray[*]}) +0:append to normal array using [key]=val with KSH_ARRAYS +>7 +>1 2 3 4 5 6 7 + local -A keyvalhash keyvalhash=(['1first element!']=first' 'value ["2second element?"]=second" "value @@ -2288,6 +2313,19 @@ F:behavior, see http://austingroupbugs.net/view.php?id=888 >new_sixth >seventh + (setopt KSH_ARRAYS + local keyvalarray + keyvalarray=(first [1]=second third [5]=sixth seventh [4]=fifth new_sixth) + print -l "${keyvalarray[@]}") +0:mixed syntax [key]=val with normal arrays with KSH_ARRAYS +>first +>second +>third +> +>fifth +>new_sixth +>seventh + local -A keyvalhash keyvalhash=(1 one [2]=two 3 three) 1:Mixed syntax with [key]=val not allowed for hash. @@ -2303,6 +2341,17 @@ F:behavior, see http://austingroupbugs.net/view.php?id=888 >KVA3three >* + (setopt KSH_ARRAYS + touch KVA1one KVA2two KVA3three + local keyvalarray + keyvalarray=(KVA* [3]=*) + print -l "${keyvalarray[@]}") +0:Globbing in non-[key]=val parts of mixed syntax with KSH_ARRAYS +>KVA1one +>KVA2two +>KVA3three +>* + local -a keyvalarray keyvalarray=(1 2 3) keyvalarray+=([1]+=a [2]=b) @@ -2310,6 +2359,14 @@ F:behavior, see http://austingroupbugs.net/view.php?id=888 0:Append to element(s) of array >1a b 3 + (setopt KSH_ARRAYS + local -a keyvalarray + keyvalarray=(1 2 3) + keyvalarray+=([0]+=a [1]=b) + print ${keyvalarray[*]}) +0:Append to element(s) of array with KSH_ARRAYS +>1a b 3 + local -A keyvalhash keyvalhash=([a]=a [b]=b [c]=c) keyvalhash+=([a]+=yee [b]=ee) @@ -2326,7 +2383,15 @@ F:behavior, see http://austingroupbugs.net/view.php?id=888 local -a keyvalarray keyvalarray=([1]=who [2]=anyway [1]+=is [1]+=that [1]+=mysterious [1]+=man) print -rl -- "${keyvalarray[@]}" -0:Append to element of associative array on creation +0:Append to element of array on creation +>whoisthatmysteriousman +>anyway + + (setopt KSH_ARRAYS + local -a keyvalarray + keyvalarray=([0]=who [1]=anyway [0]+=is [0]+=that [0]+=mysterious [0]+=man) + print -rl -- "${keyvalarray[@]}") +0:Append to element of array on creation with KSH_ARRAYS >whoisthatmysteriousman >anyway