Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Singleton arrays treated as scalars
- X-seq: zsh-workers 6047
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: Singleton arrays treated as scalars
- Date: Fri, 16 Apr 1999 09:38:57 +0200 (MET DST)
- In-reply-to: "Bart Schaefer"'s message of Fri, 16 Apr 1999 00:18:36 -0700
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author