zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: borsenkow.msk@sni.de
Cc: zsh-workers@math.gatech.edu
Subject: Re: RC_EXPAND_PARAM bug
Date: Fri, 1 Aug 1997 11:18:40 -0700	[thread overview]
Message-ID: <970801111840.ZM32223@candle.brasslantern.com> (raw)
In-Reply-To: <Pine.SV4.3.95.970801163847.21038D-100000@itsrm1>

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


      reply	other threads:[~1997-08-01 18:27 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
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 [this message]

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=970801111840.ZM32223@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=borsenkow.msk@sni.de \
    --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).