From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24687 invoked from network); 11 Feb 2003 08:42:29 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 11 Feb 2003 08:42:29 -0000 Received: (qmail 8124 invoked by alias); 11 Feb 2003 08:42:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18221 Received: (qmail 8117 invoked from network); 11 Feb 2003 08:42:20 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 11 Feb 2003 08:42:20 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.147] by sunsite.dk (MessageWall 1.0.8) with SMTP; 11 Feb 2003 8:42:20 -0000 X-VirusChecked: Checked X-Env-Sender: kiddleo@logica.com X-Msg-Ref: server-11.tower-27.messagelabs.com!1044952817!462 Received: (qmail 15490 invoked from network); 11 Feb 2003 08:40:17 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-11.tower-27.messagelabs.com with SMTP; 11 Feb 2003 08:40:17 -0000 Received: from finches.logica.co.uk ([158.234.142.11]) by iris.logica.co.uk (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id IAA28307; Tue, 11 Feb 2003 08:42:19 GMT X-Authentication-Warning: iris.logica.co.uk: Host [158.234.142.11] claimed to be finches.logica.co.uk Received: from finches.logica.co.uk (localhost [127.0.0.1]) by finches.logica.co.uk (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h1B8jcU08134; Tue, 11 Feb 2003 09:45:38 +0100 cc: zsh-workers@sunsite.dk In-reply-to: <20030207000138.GK5418@msi.ld> From: Oliver Kiddle References: <20030207000138.GK5418@msi.ld> To: Paul Ackersviller Subject: Re: set -A Date: Tue, 11 Feb 2003 09:45:38 +0100 Message-ID: <8132.1044953138@finches.logica.co.uk> Sender: kiddleo@logica.com On 6 Feb, you wrote: > I think this is a bug in all versions, but if there's some reason > the behaviour could be considered correct, it'd be nice if it at > least worked like ksh in emulation mode. I recently had some trouble > getting a ksh script to work properly in zsh, as illustrated by: > > unset arr > set -A arr "${arr[@]}" first > [ ${#arr[@]} = 2 ] && echo "arr[0]='${arr[0]}' arr[1]='${arr[1]}'" > > Note the null entry on the start of the array. I believe the above > should work as in ksh, and consistently with positional parameters, > like this: I'm inclined to agree that this is wrong. It would seem more logical to me for an unset variable to be interpreted as an empty array when retrieved in array context. A similar thing which I find annoying is that local defines parameters to be scalar by default instead of leaving their type undefined causing similar empty element problems. I've been aware of this for some while and had intended to change it if I ever have time to finish work on the parameter code. Would changing it break much? It would improve bash/ksh compatibility. 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.