<div dir="ltr"><div><div><div><div><div><div><div><div>I understand that it can be but troubling to use a block with or: and: but not xor:</div><div>Still I'm not fond of this change...<br><br></div>And indeed, we have the same laxist behavior for & and |.<br></div></div></div></div></div>See <a href="https://stackoverflow.com/questions/47424242/understanding-weird-logical-operators-in-smalltalk/47425025#47425025">https://stackoverflow.com/questions/47424242/understanding-weird-logical-operators-in-smalltalk/47425025#47425025</a><br></div><div>
<div><div><div><div><br></div><div>Didn't Eliot suggest something like:<br><br></div>Boolean>>xor: aBoolean<br></div>    ^self == aBoolean not<br><br></div>This way we don't accept aBlock but fail instantly at runtime because messageNotUnderstood: #not...</div><div>Performance-wise, we still send a message (hopefully inlined soon with sista).</div><div><br></div><div>Or maybe
<div><div><br></div>True>>xor: aBoolean<br></div>    ^aBoolean ifTrue: [false] ifFalse: [self]<br></div><div><br></div>But before changing anything, consider that the right way to handle such case</div><div>might better be to integrate QualityAssistant in the browser like in Pharo<br></div>See <a href="https://github.com/Uko/QualityAssistant">https://github.com/Uko/QualityAssistant</a><br></div><br><div><div><div><div><div><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2018-02-09 18:31 GMT+01:00 Chris Cunningham <span dir="ltr"><<a href="mailto:cunningham.cb@gmail.com" target="_blank">cunningham.cb@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">#xor: is on the same plane as #| and #& - evaluate both sides and apply<div><br></div><div>We also have #and: and #or: - evaluate receiver, and evaluate argument block if and only if necessary.</div><div><br></div><div>I use #and: and #or: for speed purposes - and to avoid side effects (sometimes).</div><div><br></div><div>I'm just curious - is there an equivalent symbol for xor similar to | and & that we could use?</div><div><br></div><div>Also, before making this change to using blocks (if we do), we'd need to fix all users - probably also in the VMMaker packages.</div><div><br></div><div>-cbc<br></div></div><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 9, 2018 at 9:18 AM, Levente Uzonyi <span dir="ltr"><<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-m_-8772893456406775893HOEnZb"><div class="gmail-m_-8772893456406775893h5">On Fri, 9 Feb 2018, marcel.taeumel wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
commits-2 wrote<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
A new version of Kernel was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Kernel-fn.1151.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox<wbr>/Kernel-fn.1151.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-fn.1151<br>
Author: fn<br>
Time: 9 February 2018, 12:32:25.516883 pm<br>
UUID: 9fb7df4b-6bf4-4af8-9c75-7496c2<wbr>f0b517<br>
Ancestors: Kernel-tonyg.1150<br>
<br>
For consistency: allow blocks to be passed into #xor: (see #or: and<br>
#and:).<br>
<br>
=============== Diff against Kernel-tonyg.1150 ===============<br>
<br>
Item was changed:<br>
  ----- Method: False>>xor: (in category 'logical operations') -----<br>
+ xor: alternativeBlock<br>
- xor: aBoolean<br>
        "Posted by Eliot Miranda to squeak-dev on 3/24/2009"<br>
<br>
+       ^alternativeBlock value!<br>
-       ^aBoolean!<br>
<br>
Item was changed:<br>
  ----- Method: True>>xor: (in category 'logical operations') -----<br>
+ xor: alternativeBlock<br>
- xor: aBoolean<br>
        "Posted by Eliot Miranda to squeak-dev on 3/24/2009"<br>
<br>
+       ^alternativeBlock value not!<br>
-       ^aBoolean not!<br>
</blockquote>
<br>
Hey Nicolas,<br>
<br>
it seems that you had the intention to not allow "a xor: [b]" because,<br>
obviously, one does always have to check both operands for XOR. Yet, would<br>
it do any harm if we would allow "a xor: [b]"?<br>
</blockquote>
<br></div></div>
Performance. Two fold: you create a block for no reason, because it will always be evaluated right after its creation.<br>
If there is no block, #value still has to be sent.<span class="gmail-m_-8772893456406775893HOEnZb"><font color="#888888"><br>
<br>
Levente</font></span><div class="gmail-m_-8772893456406775893HOEnZb"><div class="gmail-m_-8772893456406775893h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Best,<br>
Marcel<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://forum.world.st/Squeak-Dev-f45488.html" rel="noreferrer" target="_blank">http://forum.world.st/Squeak-D<wbr>ev-f45488.html</a><br>
</blockquote>
<br>
</div></div></blockquote></div><br></div>
</div></div><br><br>
<br></blockquote></div><br></div></div></div></div></div></div></div></div></div></div></div>