From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5636 invoked from network); 4 Feb 2000 18:21:07 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 4 Feb 2000 18:21:07 -0000 Received: (qmail 16202 invoked by alias); 4 Feb 2000 18:21:00 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9576 Received: (qmail 16188 invoked from network); 4 Feb 2000 18:20:59 -0000 Message-ID: <389B1886.D11A435E@u.genie.co.uk> Date: Fri, 04 Feb 2000 18:20:54 +0000 From: Oliver Kiddle X-Mailer: Mozilla 4.7 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: Zsh workers Subject: Re: Export, arrays, and ksh emulation References: <1000204171510.ZM8627@candle.brasslantern.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Bart Schaefer wrote: > > Zsh does not export arrays. It marks them exported, but does not actually > put anything into the environment. > > Ksh exports arrays by putting the first array element in the environment, > the same way that $array == ${array[0]} (as in zsh with ksh_arrays set). > > Should zsh export the first element of an array, either when ksh_arrays is > set or just under ksh emulation, or in some other condition (new option)? Well the documentation for KSH_ARRAYS says 'emulate ksh array handling as closely as possible' and its effect is not limited to numbering elements from zero so I'd say that zsh should export the first element of an array when ksh_arrays is set. Wouldn't it maybe be useful to make zsh do something when an array is marked as exported. Exporting the whole array separated by spaces might be more useful than the ksh functionality though it would be better if it was exported in a way that another zsh could reconstruct it. Maybe exporting lots of variables with square brackets aroung the index (e.g. a[1]=...) could work. Oliver