<br><br><div class="gmail_quote">On Tue, Mar 24, 2009 at 1:36 PM, Randal L. Schwartz <span dir="ltr"><<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
>>>>> "Eliot" == Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> writes:<br>
<br>
Eliot> I think just<br>
<br>
True> xor: aBoolean<br>
Eliot> ^aBoolean not<br>
<br>
False> xor: aBoolean<br>
Eliot> ^aBoolean<br>
<br>
Eliot> and then leave subsequent usage to catch possible type errors; e.g. (false<br>
Eliot> xor: #blah) ifTrue: ... will raise a mustBeBoolean error.<br>
<br>
What I don't like about this is that the right operand doesn't get a chance to<br>
"boolify" itself, or define its own xor logic. The double-dispatch versions<br>
were a lot better at that.</blockquote><div><br></div><div><br></div><div><br></div><div>If you want to do that you could implement it as</div><div><br></div><div>False> xor: aBoolean<br> ^aBoolean not not<br></div>
<div> </div><div>but I'd argue that isn't necessary. The old code didn't type check and we've lived with it for a loooong time.</div><div><br></div><div>But in any case, the not is a form of double-dispatch. It just points out that one can use not instead of xorTrue and is more comprehensible because "not" is familiar.</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<font color="#888888"><br>
--<br>
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095<br>
<<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>> <URL:<a href="http://www.stonehenge.com/merlyn/" target="_blank">http://www.stonehenge.com/merlyn/</a>><br>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.<br>
See <a href="http://methodsandmessages.vox.com/" target="_blank">http://methodsandmessages.vox.com/</a> for Smalltalk and Seaside discussion<br>
</font></blockquote></div><br>