From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3571 invoked from network); 30 Jul 1997 07:53:34 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 30 Jul 1997 07:53:34 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.8.5/8.8.5) id DAA00767; Wed, 30 Jul 1997 03:33:34 -0400 (EDT) Resent-Date: Wed, 30 Jul 1997 03:33:34 -0400 (EDT) From: "Bart Schaefer" Message-Id: <970730003323.ZM19948@candle.brasslantern.com> Date: Wed, 30 Jul 1997 00:33:23 -0700 In-Reply-To: <199707300651.CAA01564@hzoli.home> Comments: In reply to Zoltan Hidvegi "Re: RC_EXPAND_PARAM bug" (Jul 30, 2:51am) References: <199707300651.CAA01564@hzoli.home> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Zoltan Hidvegi Subject: Re: RC_EXPAND_PARAM bug Cc: zsh-workers@math.gatech.edu (Zsh hacking and development) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"bD3Yw.0.wB.Dvktp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3395 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 30, 2:51am, Zoltan Hidvegi wrote: } Subject: Re: RC_EXPAND_PARAM bug } } If `a' is empty, you want $^a/* expand to nothing, otherwise you would } get the list of files in the root directory which you do not want. } Such tricks are used in several zsh scripts I guess, and this is the } preferable behaviour. And it always worked this way, that's the point } where there is not difference between versions. That's fine, then. } One might require the evaluation of the suffix even if it is discarded } later. Do you think it is preferable? I think perhaps it is, especially if the suffix contains arithmetic or command substitutions that might have side effects. } > What does the real "rc" shell do? } } I do not think this has anything to do with rc. I'm pretty sure that it does. All the RC_ options are things that "rc" does, just like the CSH_ options are things CSH_ does, and KSH_, etc. I believe Paul originally named all the options that were borrowed from other shells by that convention. } > } It looks illogical. Either the latter should be 'ax b1x ay b1y' or the } > } former 'a1x b1x y'. } > } > I agree with Andrej on that. If you're going to map over lists, you } > have to map over them in the prefix too, not just in the suffix. } > } > However, I don't like the behavior of (3), i.e. that when ${x} is a list } > then the word break interrupts the rc-expansion. I'd prefer that the } > expansion proceed across the suffix in the same way regardless of whether } > x is an array or a string, and then introduce the word breaks at the end. } } I do not understand exatly what you mean, but I'm leaning towards option } 3. Consider: a=(a b) c="c d" e=(e f) ${^a}${c}${^e} --> "ac de" "bc de" "ac df" "bc df" Now: c=(c d) Option 2: ${^a}${c}${^e} --> ac de bc de ac df bc df Option 3: ${^a}${c}${^e} --> ac bc de df I like the symmetry between (2) and the case where c is a string. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com