From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27107 invoked from network); 30 Jun 2001 08:11:25 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Jun 2001 08:11:25 -0000 Received: (qmail 26898 invoked by alias); 30 Jun 2001 08:10:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15188 Received: (qmail 26879 invoked from network); 30 Jun 2001 08:10:27 -0000 From: "Bart Schaefer" Message-Id: <010630010938.ZM20253@candle.brasslantern.com> Date: Sat, 30 Jun 2001 01:09:38 -0700 In-Reply-To: <3B3A3177.4BA21665@u.genie.co.uk> Comments: In reply to Oliver Kiddle "Re: named references" (Jun 27, 8:18pm) References: <3B3A3177.4BA21665@u.genie.co.uk> X-Mailer: Z-Mail Lite (5.0.0 30July97) To: Zsh hackers list Subject: Re: named references MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 27, 8:18pm, Oliver Kiddle wrote: > Subject: Re: named references > > I'd be interested in more detail on the ideas you have for the > parameter code. What sort of thing might the interface provide? > > My main thoughts from what I've seen is that it would be good if it was > more flexible so that you could have something like an array of > assocations of floats. Maybe allow arrays of things of mixed type? What > other types might we want other than something like ksh namespaces > (records/structs or whatever you like to call them). All these things are, theoretically, already possible, because the associative array implementation uses a duplicate of the parameter hash table -- every associative array element is itself an entire struct param and *could* have all the attributes of any parameter. The missing bit is the necessary syntactic constructs to allow one to manipulate such complex data structures from shell script code. Even with zsh's ability to parse multi-level subscript expressions, there isn't any way to represent the assignment of, say, an entire hash table from one parameter to another -- assignment expressions, substitutions, etc. inherently work on text rather than on the internal representation of the data. Even namerefs only allow you to pass around the names of things, not the things themselves. The fact that functions can't return anything but an exit status is not helpful either. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net