From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18833 invoked from network); 17 Nov 1998 09:10:41 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 17 Nov 1998 09:10:41 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id EAA11222; Tue, 17 Nov 1998 04:04:33 -0500 (EST) Resent-Date: Tue, 17 Nov 1998 04:04:33 -0500 (EST) Message-Id: <9811170847.AA37847@ibmth.df.unipi.it> To: zsh-workers@math.gatech.edu Subject: Re: assoc array memory mucking, and semantics of patterned keys In-Reply-To: ""Bart Schaefer""'s message of "Tue, 17 Nov 1998 00:15:08 NFT." <981117001508.ZM4342@candle.brasslantern.com> Date: Tue, 17 Nov 1998 09:47:58 +0100 From: Peter Stephenson Resent-Message-ID: <"zk3dA3.0.Hl2.XmJKs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4659 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Bart Schaefer" wrote: > The final possibility is to change the meanings of (r) and (i) when an > AA is involved, so that (r) means search the values and (i) means search > the keys. Without thinking too hard, because I want to get some work done today, I think I prefer this, because the (k) and (v) flags always refer to what's returned, while the (r) and (i) flags always refer to what's being searched. It's both neat and powerful. It's maybe annoying it's different from normal arrays, but I think understandably so. Once you've got the point that (i) tells you to search the index, not return it, it's entirely logical. Otherwise the meanings of (k) and (i) are mixed in a slightly messy way. It just needs one sentence in the manual saying i [what happens with ordinary arrays] With associative arrays, specifies that the keys of the array should be searched for a match. The part of the array returned is controlled by the (k) and (v) substitution flags in this case. and pretty much everything else is covered already. -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56100 Pisa, Italy