From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12333 invoked from network); 20 Mar 2002 17:49:05 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 20 Mar 2002 17:49:05 -0000 Received: (qmail 25026 invoked by alias); 20 Mar 2002 17:48:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16871 Received: (qmail 25013 invoked from network); 20 Mar 2002 17:48:54 -0000 X-VirusChecked: Checked Date: Wed, 20 Mar 2002 17:41:45 +0000 From: Oliver Kiddle To: Peter Stephenson Cc: Zsh hackers list Subject: Re: special/readonly variables in sh emulation Message-ID: <20020320174145.GA22966@logica.com> References: <20020320125519.GA18479@logica.com> <12215.1016632380@csr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12215.1016632380@csr.com> User-Agent: Mutt/1.3.27i Sender: Oliver Kiddle On Wed, Mar 20, 2002 at 01:53:00PM +0000, Peter Stephenson wrote: > > It sounds perfectly reasonable, the difficulty is probably how you make > all the current stuff with getsparam etc. fit in with a table stored in > the parameter. Yes. I was going to try to leave things like getsparam initially so that I don't break the current stuff. > This got truncated somehow, I meant the zsh/mapfile module, where > $mapfile actually reads in a complete file of arbitrary length, and > `mapfile[...]=' or `vared mapfile[...]' writes a value to it. The way > the assignment code works, you have to retrieve the value first (in the > case of vared, even if you just finished reading and modifying the Ah, I understand now. I suppose the problem is that there is a lot of code which reads the value of a param by going straight to the u union (just grep for pm->u.str in the source to see). It would be better if all getting and setting values went through functions in param.c. Calling something like fetchvalue would return a pointer to a Param but not actually retrieve the value of the parameter. This could be defered until actually reading the value. So there will need to be functions which do things like return association keys or assign to an array range in the method table. We could even make the param struct an opaque type - passing Params out as void pointers so that only code in params.c can dig about inside it. I'm not sure it is worth the bother though. Would it be a good idea to allow arrays to be arrays of any type such as integers. Ksh arrays can be arrays of floats, scalars or integers but not arrays of arrays or namespaces. Oliver This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.