<br><br><div class="gmail_quote">On Mon, Mar 23, 2009 at 6:32 PM, Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>></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: '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</blockquote><div><br></div><div>I think just</div><div><br></div><div>True>>xor: aBoolean</div><div> ^aBoolean not</div><div><br></div><div>False>>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>>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...</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'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" target="_blank">keith_hodges@yahoo.co.uk</a>></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 ] => 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>