From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22383 invoked from network); 4 Aug 1997 17:43:12 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 4 Aug 1997 17:43:12 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.8.5/8.8.5) id NAA06968; Mon, 4 Aug 1997 13:21:07 -0400 (EDT) Resent-Date: Mon, 4 Aug 1997 13:21:07 -0400 (EDT) From: (Zoltan T. Hidvegi) Message-Id: <9708041721.AA19076@belgium.fishkill.ibm.com> Subject: Re: RC_EXPAND_PARAM final patch In-Reply-To: from Andrej Borsenkow at "Aug 4, 97 06:28:41 pm" To: borsenkow.msk@sni.de Date: Mon, 4 Aug 1997 13:21:09 -0400 (EDT) Cc: zsh-workers@math.gatech.edu (Zsh workers list) X-Mailer: ELM [version 2.4ME+ PL31H (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"v_-E6.0.pi1.3-Wvp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3419 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Andrej Borsenkow wrote: > Totally agreed. If I get it right, the patch does following: > make substitutions (converting $^a into {a[1],a[2],...} > word-split the result (it can result in lists in {...} being extended > if SH_WORD_SPLIT is set) > make brace expansion in each word (with implicit word splitting) Yes. The current mechanism is not exactly like this, but I'm goint to change it and this is exactly I'm going to do. Replace $^x with a brace expansion list, and expand it later in together with other braces. Currently there are several problems: belgium ~ % echo {a,b}{x,y} ax ay bx by That fine. belgium ~ % x=(x y) belgium ~ % echo {a,b}$^x ax bx ay by Do you see the difference? This is going to change. The other problem: belgium ~ % echo {$x,z}a {x y,z}a It is probably not what you would expect, although ksh behaves this way. I'm goint to change it so that the result will be 3 words: x ya za But this would mean an other change: ${x}{a,b} will expand to 4 words, x ya x yb instead of the current x ya yb. The current behaviour is the way ksh behaves, and the planned new one is similar to bash (you can use $* and $@ to study the behaviour of arrays in bash and ksh). > > Here a${(e)^foo}b${(e)foo} is substituted to two identical > > a$[i++]b${(e)foo} arguments, and substitution for these arguments is > > started from the beginning. > > It is the most surprising thing I ever seen in ZSH!!! _NO_ word in manuals > ever suggested such interpretation. I was always shure that > ${(e)a} just gets recursivly expanded, which is what I call consistent and The (e) stuff is completely broken, this will be fixed and it'll work like you'd expect. Zoltan