From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22859 invoked from network); 17 Nov 1998 09:51:26 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 17 Nov 1998 09:51:26 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id EAA12335; Tue, 17 Nov 1998 04:44:39 -0500 (EST) Resent-Date: Tue, 17 Nov 1998 04:44:39 -0500 (EST) Date: Tue, 17 Nov 1998 10:42:41 +0100 (MET) Message-Id: <199811170942.KAA11817@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@math.gatech.edu In-reply-to: Peter Stephenson's message of Tue, 17 Nov 1998 09:47:58 +0100 Subject: Re: assoc array memory mucking, and semantics of patterned keys Resent-Message-ID: <"9z4xk2.0.g03.7MKKs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4661 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Peter Stephenson wrote: > > "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. Agreed. Also, I would like to have ${(k)param[(r)pat]} on normal arrays work like $param[(i)pat] (as Bart suggested in his list). I probably would even want ${(kv)param[(i)pat]} (and the same with (r)) give a list of indixes and values for normal arrays, just to make things more consistent. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de