zsh-workers
 help / color / mirror / code / Atom feed
From: <hzoli@VNET.IBM.COM> (Zoltan T. Hidvegi)
To: borsenkow.msk@sni.de
Cc: hzoli@VNET.IBM.COM, zsh-workers@math.gatech.edu
Subject: Re: RC_EXPAND_PARAM final patch
Date: Wed, 6 Aug 1997 23:53:44 -0400 (EDT)	[thread overview]
Message-ID: <9708070353.AA22734@belgium.fishkill.ibm.com> (raw)
In-Reply-To: <Pine.SV4.3.95.970806161128.13915G-100000@itsrm1> from Andrej Borsenkow at "Aug 6, 97 04:27:20 pm"

Andrej Borsenkow wrote:
> % a=(a "b ")
> % x=(x "y z")
[...]
> % setopt shwordsplit
> % args ${^a}1
> "a1" "b1" "1"
> % args ${^x}1
> "x1" "y1" "z1"     ????
>
> Shouldn't it be  "x1" "y" "z1"  ?

Why? ${^x} in itself expands to 3 words, x y z, and that's combined with
`1'.  With sh_word_split, a word with spaces acts like an array.

The first example is a bit more hard to understand.  Here ${^a} expands to
3 words too, but the last word is a null word, which is removeded from the
argument list, unless it is contacenated with something real.  That's why
${^a}1 expands to a1 b1 1, just immagine an invisible zero-length word
before the last 1.

Zoltan


      reply	other threads:[~1997-08-07  4:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-02  7:27 Zoltan Hidvegi
1997-08-02 19:28 ` Bart Schaefer
1997-08-04 14:28 ` Andrej Borsenkow
1997-08-04 16:02   ` Peter Stephenson
1997-08-04 17:21   ` Zoltan T. Hidvegi
1997-08-04 18:39     ` Bart Schaefer
1997-08-04 18:51       ` Zoltan T. Hidvegi
1997-08-04 19:10         ` Bart Schaefer
1997-08-06 12:27     ` Andrej Borsenkow
1997-08-07  3:53       ` Zoltan T. Hidvegi [this message]

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=9708070353.AA22734@belgium.fishkill.ibm.com \
    --to=hzoli@vnet.ibm.com \
    --cc=borsenkow.msk@sni.de \
    --cc=zsh-workers@math.gatech.edu \
    /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).