<br><br><div class="gmail_quote">On Tue, Mar 24, 2009 at 1:36 PM, Randal L. Schwartz <span dir="ltr">&lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
&gt;&gt;&gt;&gt;&gt; &quot;Eliot&quot; == Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; writes:<br>
<br>
Eliot&gt; I think just<br>
<br>
True&gt; xor: aBoolean<br>
Eliot&gt;     ^aBoolean not<br>
<br>
False&gt; xor: aBoolean<br>
Eliot&gt;     ^aBoolean<br>
<br>
Eliot&gt; and then leave subsequent usage to catch possible type errors; e.g. (false<br>
Eliot&gt; xor: #blah) ifTrue: ... will raise a mustBeBoolean error.<br>
<br>
What I don&#39;t like about this is that the right operand doesn&#39;t get a chance to<br>
&quot;boolify&quot; 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&gt; xor: aBoolean<br>    ^aBoolean not not<br></div>
<div> </div><div>but I&#39;d argue that isn&#39;t necessary.  The old code didn&#39;t type check and we&#39;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 &quot;not&quot; 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>
&lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt; &lt;URL:<a href="http://www.stonehenge.com/merlyn/" target="_blank">http://www.stonehenge.com/merlyn/</a>&gt;<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>