lua-users home
lua-l archive

Re: Associativity

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > and don't mention optimisation of commutative operations in the
> > language definition, but only do it in cases where it makes no
> > difference.
> 
> That means never :( Lua has dynamic typing, so the compiler cannot tell
> whether changing order will make any difference...
Ah, I see. You can tell that one operand is a constant, but you can't tell 
what the other is, and a method might want to use a numeric operand on one 
side, but not on the other...
In that case, I suppose you do need explicit rules.
-- 
http://www.mupsych.org/~rrt/ | art, n. romanticized mundanity

AltStyle によって変換されたページ (->オリジナル) /