<br><br><div class="gmail_quote">On Mon, Mar 23, 2009 at 6:32 PM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
1) #xor: should not take a block as argument.<br>Rationale:<br>- the block would ALWAYS have to be evaluated<br>- block arguments are either for repeated evaluation, or condiitonal evaluation...<br>This is not the case here, so the need of a block argument vanishes...<br>

<br>2) #xor: argument should be a Boolean, but here no guard is made.<br><br>We could eventually add:<br>   aBoolean isBoolean ifFalse; [self error: &#39;xor must take a boolean as argument&#39;]<br><br>Or if we want to later extend to some other class:<br>

True&gt;&gt;xor: aBoolean<br>    ^aBoolean xorTrue<br>
False&gt;&gt;xor: aBoolean<br>
    ^aBoolean xorFalse<br>True&gt;&gt;xorTrue<br>    ^false<br>
True&gt;&gt;xorFalse<br>
    ^self<br>

False&gt;&gt;xorTrue<br>

    ^true<br>False&gt;&gt;xorFalse<br>

    ^self</blockquote><div><br></div><div>I think just</div><div><br></div><div>True&gt;&gt;xor: aBoolean</div><div>    ^aBoolean not</div><div><br></div><div>False&gt;&gt;xor: aBoolean</div><div>    ^aBoolean</div><div>
<br></div><div>and then leave subsequent usage to catch possible type errors; e.g. (false xor: #blah) ifTrue: ... will raise a mustBeBoolean error.</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;">
MySymbolicBooleanClass&gt;&gt;xorTrue<br>    ^SymbolicXorOperation with: self with: true<br><br>I&#39;m not sure whether we need to protect or not...<br>I tend to avoid over-protecting code. As long as a debugger opens, I claim protecting is void...</blockquote>
<div><br></div><div>+1</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
But here, I don&#39;t like a false program proceeding without a Notifier....<br><br>Nicolas<br><br><div class="gmail_quote">2009/3/24 Keith Hodges <span dir="ltr">&lt;<a href="mailto:keith_hodges@yahoo.co.uk" target="_blank">keith_hodges@yahoo.co.uk</a>&gt;</span><div class="im">
<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">true xor: [ true ]  =&gt; true<br>
<br>
discuss<br>
<font color="#888888"><br>
Keith<br>
<br>
<br>
<br>
</font></blockquote></div></div><br>
<br><br>
<br></blockquote></div><br>