From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21703 invoked from network); 16 Apr 1999 07:53:08 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Apr 1999 07:53:08 -0000 Received: (qmail 27829 invoked by alias); 16 Apr 1999 07:53:00 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6049 Received: (qmail 27818 invoked from network); 16 Apr 1999 07:52:58 -0000 To: zsh-workers@sunsite.auc.dk Path: mason From: mason@primenet.com.au (Geoff Wing) Newsgroups: lists.zsh.workers Subject: Re: Singleton arrays treated as scalars Date: 16 Apr 1999 07:52:48 GMT Organization: PrimeNet Computer Consultants Distribution: local Message-ID: References: <990416001836.ZM13152@candle.brasslantern.com> Reply-To: mason@primenet.com.au NNTP-Posting-Host: coral.primenet.com.au X-Trace: coral.primenet.com.au 924249168 21589 203.43.15.2 (16 Apr 1999 07:52:48 GMT) X-Complaints-To: usenet@coral.primenet.com.au NNTP-Posting-Date: 16 Apr 1999 07:52:48 GMT User-Agent: slrn/0.9.5.4 (UNIX) Bart Schaefer typed: :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? It's a pf artifact. Looking in 2.00.03 sees it there in a slightly different incantation but logically the same. -- Geoff Wing Mobile : (Australia) 0412 162 441 Work URL: http://www.primenet.com.au/ Ego URL: http://pobox.com/~gcw/