From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27369 invoked from network); 1 Aug 1997 18:27:40 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 1 Aug 1997 18:27:40 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.8.5/8.8.5) id OAA07166; Fri, 1 Aug 1997 14:18:54 -0400 (EDT) Resent-Date: Fri, 1 Aug 1997 14:18:54 -0400 (EDT) From: "Bart Schaefer" Message-Id: <970801111840.ZM32223@candle.brasslantern.com> Date: Fri, 1 Aug 1997 11:18:40 -0700 In-Reply-To: Comments: In reply to Andrej Borsenkow "Re: RC_EXPAND_PARAM bug" (Aug 1, 5:17pm) References: X-Mailer: Z-Mail (4.0b.820 20aug96) To: borsenkow.msk@sni.de Subject: Re: RC_EXPAND_PARAM bug Cc: zsh-workers@math.gatech.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"3ttCK2.0.sl1.DYYup"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3402 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Aug 1, 5:17pm, Andrej Borsenkow wrote: } Subject: Re: RC_EXPAND_PARAM bug } } pre-beta16 treats `^' as ternary operator: } xx$^ayy -> xx^$a^yy (in rc notation) } current treats `^' as binary operator with right precedence: } xx$^ayy -> xx($a^y) } } Correct me, if I am wrong. Should that read xx${^a}yy -> xx^($a^yy) ?? The step you're omitting is that what happens when xx and yy represent arrays differs from what happens when xx and yy represent strings. xx${a}yy --> xx^${a}^yy --> xx^(ayy byy) --> xxayy xxbyy b=(p q) xx${a}${b} --> xx^(a b)^(p q) --> xx^(ap bq bp) --> xxap xxbq xxbp c=(m n) ${c}${a}${b} --> (m n)^(a b)^(p q) --> (m n)^(ap bq bp) --> mbp nap nbq nbp What I find weird about this is the way the first element of the left side gets paired only with the last element of the right side. One of the array iterators is not getting started over when it should. The more elements there are in each array, the stranger it gets. } Both is acceptable as long as it is documented ;) I agree that both are acceptable, because they ought to be completely equivalent! The current behavior is not acceptable because it doesn't obey any such straightforward operator rule. } Oh, I almost forgot my proposal ... } } - get rid of ^ as subst modifier } - use explicit operator notation I think it's far too late for this. Too great an incompatibility with existing zsh. (We could add an operator notation, but we can't get rid of the subst modifier.) -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com