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: 'xor must take a boolean as argument']<br><br>Or if we want to later extend to some other class:<br>
True>>xor: aBoolean<br> ^aBoolean xorTrue<br>
False>>xor: aBoolean<br>
^aBoolean xorFalse<br>True>>xorTrue<br> ^false<br>
True>>xorFalse<br>
^self<br>
False>>xorTrue<br>
^true<br>False>>xorFalse<br>
^self<br><br>MySymbolicBooleanClass>>xorTrue<br> ^SymbolicXorOperation with: self with: true<br><br>I'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...<br>
But here, I don'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"><<a href="mailto:keith_hodges@yahoo.co.uk">keith_hodges@yahoo.co.uk</a>></span><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 ] => true<br>
<br>
discuss<br>
<font color="#888888"><br>
Keith<br>
<br>
<br>
<br>
</font></blockquote></div><br>