zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Zoltan Hidvegi <hzoli@frontiernet.net>,
	mason@primenet.com.au, zsh-workers@math.gatech.edu
Subject: Re: RC_EXPAND_PARAM bug
Date: Tue, 29 Jul 1997 09:27:05 -0700	[thread overview]
Message-ID: <970729092705.ZM16897@candle.brasslantern.com> (raw)
In-Reply-To: <199707290736.DAA03285@hzoli.home>
In-Reply-To: <slrn5tr7vr.jsh.mason@coral.primenet.com.au>

On Jul 29,  3:36am, Zoltan Hidvegi wrote:
} Subject: Re: RC_EXPAND_PARAM bug
}
} > Can you generalize this rule for us?  E.g.
} > 
} > % echo ${^a}$[i++]$[++j]${^x}....
} > 
} > where .... is some arbitary number of other substitutions?  Is it just that
} > it now does everything from right to left instead of left to right?  Why?
} 
} No, it is left to right.  ${^a} is expanded first, then the remaining
} part, $[i++]$[++j]${^x} is expanded separately, and the result is
} combined with the expansion of ${^a}.  You can see it if you try
} 
} let i=0; echo $[i++]${^a}$[i++]
} 
} which gives
} 
} 0a1 0b1

I'm still not comprehending this.

Are you saying that all the variables are expanded first, left to right,
and then all the resulting strings are combined?  Whereas before (2.6 and
earlier) each variable would be expanded and combined with what followed,
and then the process repeated for each new string?

On Jul 29,  7:47am, Geoff Wing wrote:
} Subject: Re: RC_EXPAND_PARAM bug
}
} :The logic is that the string after the rc-param, 1${^^x}, is expanded,
} :producing two strings, 1x y, which is combined with 1a 1b.  It is true
} 
} I don't get this,  shouldn't 1${^^x} produce one string "1x y"?  And then the
} expansion of 1${^a}1${^^x} be the string "1a1x y 1b1x y"?  Your logic 
} indicates to me that it's producing array like thingies.  Is this dependant
} on some other wierd option?  Please explain before I go mental.

The trick there is that x is an array variable, so it produces two strings.
The setting of rcexpandparam doesn't affect that part.

zagzig% a=(a b)
zagzig% x=(x y)
zagzig% echo 1${^a}1${^^x}
1a1x 1ay 1b1x 1by
zagzig% echo 1${^a}1${^x} 
1a1x 1a1y 1b1x 1b1y


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~1997-07-29 16:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-28 13:42 Andrew Main
1997-07-28 16:26 ` Bart Schaefer
1997-07-29  6:04   ` Zoltan Hidvegi
1997-07-29  7:09     ` Bart Schaefer
1997-07-29  7:36       ` Zoltan Hidvegi
1997-07-29  7:47     ` Geoff Wing
1997-07-29 16:27       ` Bart Schaefer [this message]
1997-07-30  3:04         ` Geoff Wing
1997-07-30  3:56           ` Bart Schaefer
1997-07-30  5:16         ` Zoltan Hidvegi
1997-07-30  5:46           ` Andrej Borsenkow
1997-07-30  6:11           ` Bart Schaefer
1997-07-30  6:51             ` Zoltan Hidvegi
1997-07-30  7:33               ` Bart Schaefer
1997-07-30  8:18           ` Andrew Main
1997-07-30 15:54             ` Andrej Borsenkow
1997-07-30 17:05               ` Bart Schaefer
1997-08-01 13:17                 ` Andrej Borsenkow
1997-08-01 18:18                   ` 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=970729092705.ZM16897@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=hzoli@frontiernet.net \
    --cc=mason@primenet.com.au \
    --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).