zsh-workers
 help / color / mirror / code / Atom feed
From: <hzoli@VNET.IBM.COM> (Zoltan T. Hidvegi)
To: schaefer@brasslantern.com (Bart Schaefer)
Cc: zsh-workers@math.gatech.edu (Zsh workers list)
Subject: Re: RC_EXPAND_PARAM final patch
Date: Mon, 4 Aug 1997 14:51:09 -0400 (EDT)	[thread overview]
Message-ID: <9708041851.AA16992@belgium.fishkill.ibm.com> (raw)
In-Reply-To: <970804113944.ZM21422@candle.brasslantern.com> from Bart Schaefer at "Aug 4, 97 11:39:43 am"

Bart Schaefer wrote:
> On Aug 4,  1:21pm,  (Zoltan T. Hidvegi) wrote:
> } Subject: Re: RC_EXPAND_PARAM final patch
> }
> } belgium ~ % echo {$x,z}a
> } {x y,z}a
> }
> } It is probably not what you would expect, although ksh behaves this way.
>
> Actually, this is exactly what I'd expect.  The $x is inside the { },
> so the entire value of $x should be treated as part of the brace
> expansion.

I do not understand you.  Yes, I agree, that the entire value of $x should
be treated as part of the brace expansion, but this is not what happens
right now, as the result is two words, `{x' and `y,z}a', with braces
appearing in the result and not used for brace expansion.  I thought that
this is not what you expect.  What I would expect is 3 word result,

x ya za

> What, then, is the result of `echo {w,$x,z}a' ?  I can't imagine that
> anyone would expect that to be the same as `{w,x} {y,z}a'.  Who told
> zsh to put the extra } { in there?

Noone.  The result will be 4 words,

wa x ya za

This is different from the result of {w,x} {y,z}a which is w x ya za.  Or
do you have some more reasonable alternative?

> } But this would mean an other change: ${x}{a,b} will expand to 4 words,
> }
> } x ya x yb
>
> This is fine, assuming that {p,q}${x}{a,b} expands to 8 words
>
> px ya qx ya px yb qx yb

Almost, but the order is different:

px ya px yb qx ya qx yb

Zoltan


  reply	other threads:[~1997-08-04 18:55 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 [this message]
1997-08-04 19:10         ` Bart Schaefer
1997-08-06 12:27     ` Andrej Borsenkow
1997-08-07  3:53       ` Zoltan T. Hidvegi

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=9708041851.AA16992@belgium.fishkill.ibm.com \
    --to=hzoli@vnet.ibm.com \
    --cc=schaefer@brasslantern.com \
    --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).