zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Singleton arrays treated as scalars (redux)
Date: Tue, 1 Jun 1999 10:49:16 +0200 (MET DST)	[thread overview]
Message-ID: <199906010849.KAA20110@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Tue, 1 Jun 1999 04:50:15 +0000


Bart Schaefer wrote:

> I think I've figured out why paramsubst() converts one-element arrays into
> scalars.  Consider the case where zsh needs to expand
> 
> 	some${param}thing
> ...
> 
> The one-element array case can't be handled like the two-or-more case; it
> must be handled like the scalar case.  So zsh does the simplest thing, and
> turns the array into a scalar so that it will take that code branch.  This
> also prevents it from attempting plan9 (rcexpandparam) concatenation when
> there is only one element.

Aha.

> However, there's one spot where I think mult_isarr is not correctly set,
> and another spot where isarr is compared to 2 even though in that branch
> it can't possibly have any value other than 0.  Patch appended, someone
> please check it for sanity.

As far as I can see, this looks good (I saw this superfluous isarr!=2, 
too, when playing with mult_isarr, I was just to superstitious to
remove it).


Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~1999-06-01  8:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-01  8:49 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-06-01  4:50 Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199906010849.KAA20110@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).