Larry Wall |Perl 6| wrote:
Well, that's more or less how Icon does it, but we're not going to expose
anything like that to the user.  If we assume that comparisons take two
immutable objects, we can leave it to the compiler to compute the actual
value once, and then feed it to both sides of the implicit AND.  The
user just writes an ordinary binary comparison that returns a boolean.

For several years now I've been treating any use of "but" as a code
smell, and changing the design so it isn't necessary.  It's been a
rather useful construct that way, like "eval" and "BEGIN". :)

Thanks for the clarification, Larry.
* hidden from the user (no funny return values, no funny way to write the function)
 * argument only evaluated once
Any strong feeling about order-of-evaluation issues?

I assume this extends to any user-written infix:{'<'} since we're not supposed to reuse existing operators for different purposes, but only to extend the domain of the same meaning.

So how about making a new operator or set of operators that will have the same behavior? I don't like compiler magic that is not available for reuse <g>.

Is "chained" associativity specific to this (functions return Bool and are ANDed pairwise), or can it be used for other things like ganging $a+$b+$c+$d to a single +(*$L,*$R,Vector [EMAIL PROTECTED]) function that doesn't keep re-allocating and copying memory but does it all in one shot?


Reply via email to