From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25313 invoked from network); 10 Jun 1998 12:11:56 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 10 Jun 1998 12:11:56 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id IAA06734; Wed, 10 Jun 1998 08:06:59 -0400 (EDT) Resent-Date: Wed, 10 Jun 1998 08:06:59 -0400 (EDT) Sender: B.Stephens@isode.com To: zsh-workers@math.gatech.edu Subject: Re: Associative arrays, structured namespaces References: <199806101044.LAA12918@taos.demon.co.uk> Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: text/plain; charset=US-ASCII From: Bruce Stephens Date: 10 Jun 1998 13:07:29 +0100 In-Reply-To: Zefram's message of "Wed, 10 Jun 1998 11:44:51 +0100 (BST)" Message-ID: X-Mailer: Gnus v5.6.10/XEmacs 19.16 - "Lille" Resent-Message-ID: <"rpbKG1.0.6f1.YRdVr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4088 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Zefram writes: > Bruce Stephens wrote: > >This strikes me as an excellent idea. Presumably the implementation > >is similar to that of associative arrays, though? > > No. The way it's done in Elate, the shell just treats the structured > variable name as an opaque string. It's only convention that interprets > the name as having structure. Associative arrays is a completely > separate issue. Yes, I wasn't thinking clearly. I was thinking that adding a SET function to shell.path (which would be called shell.SET, I suppose) and all that kind of functionality would be harder without regarding things as separate associated arrays, but I'm clearly wrong: it's still dead easy with a single namespace, because you know exactly what you're looking for. Supposing zsh has a hash table of parameter names which pointed at values; couldn't the hash just be replaced by a btree or something? Wouldn't that provide enough to reasonably efficiently produce all variables beginning with some prefix? Probably you're right, though: associative arrays ought to be done specially, if they're done at all. Come to think of it, having an associative array very_long_prefix.put_keys_next.* would probably be too expensive done as a set of variables. Yeah, you're definitely right: keep things simple.