From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21406 invoked from network); 16 Apr 1999 07:39:10 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Apr 1999 07:39:10 -0000 Received: (qmail 26432 invoked by alias); 16 Apr 1999 07:38:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6047 Received: (qmail 26425 invoked from network); 16 Apr 1999 07:38:58 -0000 Date: Fri, 16 Apr 1999 09:38:57 +0200 (MET DST) Message-Id: <199904160738.JAA16057@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Fri, 16 Apr 1999 00:18:36 -0700 Subject: Re: Singleton arrays treated as scalars Bart Schaefer wrote: > I tried this again and got much better results for two-or-more element > arrays, but singleton arrays were still getting subscripted as scalars. > Investigation led me to this fragment of paramsubst(): > > if (isarr > 0 && !plan9 && (!aval || !aval[0])) { > val = dupstring(""); > isarr = 0; > } else if (isarr && aval && aval[0] && !aval[1]) { > val = aval[0]; > isarr = 0; > } > > Well, look at that. If we have a singleton array, make it into a scalar. > This doesn't have anything to do with multsub() at all! > > Does anybody remember why this code is here? What part of the world is > going to come crashing down if that "else if" clause gets deleted? When buildin the patch I just sent, I stumbled over this, too. And no, I have no idea whence this came or what would happen, if... Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de