[e-lang] Couple of newbie questions

Kevin Reid kpreid at mac.com
Wed Dec 27 08:20:41 CST 2006


On Dec 27, 2006, at 0:15, Mark S. Miller wrote:

>              /** Exact divide, which isn't "/" or "//" */
>              to divide(other :Rational) {
>                  return makeRational(nn*other.denom(),
>                                      dd*other.numer())
>              }

I'd like to see E's division protocol modified such that one of the  
infix operators *is* appropriate for exact rational division. If it  
was, I would then add support for native rationals to E-on-CL.

> * In E, infix expressions (except for "==" and "!=") maintain the  
> left-to-right trust relationship of normal message sends. The  
> answer is according to the receiver (the left operand). In other  
> words, the receiver speaks for the result. In "x + y", we can  
> generally rely on the result being as number-like as we can rely on  
> x being number-like, irrespective of what kind of thing y is. If y  
> is something weird, that's x's problem, not ours.

This suggests that one will sometimes want messages which are flipped  
versions of noncommutative infix operators.

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list