From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20463 invoked from network); 29 Jul 1997 07:49:22 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 29 Jul 1997 07:49:22 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.8.5/8.8.5) id DAA14679; Tue, 29 Jul 1997 03:36:55 -0400 (EDT) Resent-Date: Tue, 29 Jul 1997 03:36:55 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199707290736.DAA03285@hzoli.home> Subject: Re: RC_EXPAND_PARAM bug In-Reply-To: <970729000902.ZM15018@candle.brasslantern.com> from Bart Schaefer at "Jul 29, 97 00:09:02 am" To: schaefer@nbn.com Date: Tue, 29 Jul 1997 03:36:48 -0400 (EDT) Cc: zsh-workers@math.gatech.edu (Zsh hacking and development) X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"wBwah1.0.Fb3.MsPtp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3384 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > On Jul 29, 2:04am, Zoltan Hidvegi wrote: > > > > % echo 1${^a}1${^^x} > > 1a1x 1ay 1b1x 1by > > > > 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 > > that this is incompatible with 2.6-beta16 and older, which first expanded > > it to 1a1${^^x} 1b1${^^x} and later this was expanded to 1a1x y 1b1x y. > > Similarily, let i=0; echo ${^a}$[i++] expanded to a$[i++] b$[i++] and > > later to a0 b1, while in zsh-3.0.4 it expands to a0 b0. > > 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 If it were right to left, it would be 1a0 1b0. Zoltan