From: dblack@... Date: 2003-02-12T11:28:01+09:00 Subject: Re: Operator reordering, good idea? (was Re: ruby-dev summary 19457-19539) Hi -- On Tue, 11 Feb 2003, Tanaka Akira wrote: > Do you have any example for == which should not be commutative? Well, I would have thought this: Exception.new("a") == "a" :-) But seriously... my problem with that example being "true" is that it's only using Exception#to_s after doing a kind of right-to-left backtracking, *after* seeing that a String object is -- no, *was* -- needed. My instinct is to say: if you get as far as having sent a message to an object, it's too late to reconsider what that object is. Also, if == can backtrack, why not: Exception.new("a") << "b" # # and so on. "Why not?" might be: having everything be exactly consistent and symmetrical isn't necessarily best for the language, and what's good for == isn't automatically good for << and others. But I think having any of this kind of right-to-left backtracking and re-evaluation feels very anomalous. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav