From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16528 invoked from network); 31 Mar 2004 15:59:02 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 31 Mar 2004 15:59:02 -0000 Received: (qmail 17630 invoked by alias); 31 Mar 2004 15:58:47 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19713 Received: (qmail 17619 invoked from network); 31 Mar 2004 15:58:46 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 31 Mar 2004 15:58:46 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 31 Mar 2004 15:58:45 -0000 Received: (qmail 23740 invoked from network); 31 Mar 2004 15:58:45 -0000 Received: from wbar3.sjo1-4-11-009-147.sjo1.dsl-verizon.net (HELO candle.brasslantern.com) (4.11.9.147) by a.mx.sunsite.dk with SMTP; 31 Mar 2004 15:58:43 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id i2VFwfh29271 for zsh-workers@sunsite.dk; Wed, 31 Mar 2004 07:58:41 -0800 X-Authentication-Warning: candle.brasslantern.com: schaefer set sender to schaefer@closedmail.com using -f From: Bart Schaefer Message-Id: <1040331155841.ZM29270@candle.brasslantern.com> Date: Wed, 31 Mar 2004 15:58:40 +0000 In-Reply-To: <15526.1080739251@trentino.logica.co.uk> Comments: In reply to Oliver Kiddle "PATCH: subscript flags on lhs of assignment" (Mar 31, 3:20pm) References: <15526.1080739251@trentino.logica.co.uk> X-Mailer: Z-Mail (5.0.0 30July97) To: Zsh workers Subject: Re: PATCH: subscript flags on lhs of assignment MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: **** X-Spam-Status: No, hits=4.7 required=6.0 tests=RCVD_IN_DYNABLOCK, RCVD_IN_NJABL,RCVD_IN_NJABL_DIALUP,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 4.7 On Mar 31, 3:20pm, Oliver Kiddle wrote: } } The SCANPM_MATCHMANY flag also seems to get set for the (k) } flag. Is that a bug? No, it's a hack to work around another shortcoming. In order to use the keys as the search patterns, I had to pretend to be interested in all the keys, even though only one of them will eventually be used to return a matching element. Or something to that effect, it's been a very long time since I wrote that code. } There may well be better ways to implement this. Using the (k), (i) and } (r) flags seems to result in one element arrays instead of single } values I believe that's because, for "normal" arrays, you can do slices with two patterns e.g. $array[(r)left,(i)right]. It's because they return one-element arrays that assignments previously didn't work for associatives. } This seems to work and is fairly minimal Nice. You'll need to update the docs, of course; the INability to use a pair of patterns for associative arrays should have been explicitly mentioned before, and the stuff about assignments not working will have to move from the "r" section to the "R" section.