From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10622 invoked from network); 18 Feb 2001 01:44:21 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 Feb 2001 01:44:21 -0000 Received: (qmail 12993 invoked by alias); 18 Feb 2001 01:44:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13499 Received: (qmail 12982 invoked from network); 18 Feb 2001 01:44:15 -0000 From: "Bart Schaefer" Message-Id: <1010218014317.ZM20759@candle.brasslantern.com> Date: Sun, 18 Feb 2001 01:43:17 +0000 In-Reply-To: <20010217005359.7B9C8139BA@pwstephenson.fsnet.co.uk> Comments: In reply to Peter Stephenson "Re: 4.0.1-pre-1" (Feb 17, 12:53am) References: <20010217005359.7B9C8139BA@pwstephenson.fsnet.co.uk> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Subject: Re: 4.0.1-pre-1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 17, 12:53am, Peter Stephenson wrote: } Subject: Re: 4.0.1-pre-1 } } Ignoring most of the items which are associated with long discussions } (pah!) or the ones which may not even be bugs (pah! pah!): We should at least record somewhere (the BUGS file?) those that really are bugs, so that we don't forget to address them later. } > There's the ksh incompatibility with array export, 9576. } } There's some commented-out code in there in one place already. I think we } should make ksharrays export the first word and with noksharrays, to be } logical, export the array joined the same way we always get an array as a } single word (c.f. singsub()). We should make sure we don't export the } array if it's tied to a colon-array. I don't think we should export } associative arrays at all --- the order is undefined, so we can't guarantee } compatibility with ksh, nor promise a particular form for the non-ksh } exported value. Unless anyone has ideas. The way ksh appears to treat an unsubscripted associative array reference is to substitute the element whose hash key is "0". That is, no matter what kind of array it is, $array == $array[0]. The associative array code in getstrvalue() already does this, but only when `emulate ksh' is in effect (just ksharrays is not enough to activate it). So one issue is whether `emulation == EMULATE_KSH' should be replaced by `isset(KSHARRAYS)' in a number of places in params.c. For noksharrays, I think we should just leave well enough alone and not export the arrays at all. The only reason to export one is because you want to import it again, and tying to a colon-array is a more reliable way of accomplishing that. Of course there are joining/splitting issues either way. We could export an array as a whole bunch of variables ARRAY[0]=... etc., but then some programs (older shells in particular) get all huffy because the string to the left of the `=' is "not an identifier". -- 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