From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13577 invoked from network); 19 Mar 2002 01:44:26 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 19 Mar 2002 01:44:26 -0000 Received: (qmail 19919 invoked by alias); 19 Mar 2002 01:44:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16860 Received: (qmail 19908 invoked from network); 19 Mar 2002 01:44:20 -0000 Date: Mon, 18 Mar 2002 17:43:53 -0800 (PST) From: Bart Schaefer Sender: schaefer@ns1.sodaware.com To: zsh-workers@sunsite.dk Subject: Re: special/readonly variables in sh emulation In-Reply-To: <20020318154119.GA11181@logica.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 18 Mar 2002, Oliver Kiddle wrote: > We perhaps ought to rethink the status of any special variables > in sh emulation mode. Especially those which are autoloaded out of > places like zsh/parameter. Any ideas on how to solve this? My suggestion would be simply to disable module autoloading entirely when in sh emulation mode (and maybe ksh too). A sh/ksh script can't possibly be expecting a dynamically loaded module, and "compinit" et al. can load anything they explicitly need. A slightly less drastic approach might be to disable autoloading only for non-interactive sh emulation. On Mon, 18 Mar 2002, Peter Stephenson wrote: > Another is to shift this sort of parameter into a namespace, as we've > been planning for a long time. I think Sven had a way of doing this > simply by allowing dots in parameter names --- it wasn't a fully > featured namespace implementation, but it might be close enough to allow > us to go over to that if anybody had the time to write it. I've fooled around with this a bit. The problem is that you have to allow the dots only inside ${...}, because lots of things break if $file.ext is interpreted as ${file.ext} rather than ${file}.ext. This is a little tricky to acheive, because there'd need to be different typtab[] flags for lexing inside braces v. outside. On Mon, 18 Mar 2002, Oliver Kiddle wrote: > Compound variables could be implemented better by being like > associative arrays - the parent is a hash table of the elements the > only difference being the elements can be any type, and the syntax is > different. This alone wouldn't be hard to add onto the existing > parameter code. In fact, I deliberately used full parameter hash tables for the associative array implementation precisely so they could be extended in the future to support elements of any type. What's needed is a sensible reference and assignment syntax. > Also, am I right that we *need* a=() to assign an empty array? No; `set -A a' will do it.