<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/9 Colin Putney <span dir="ltr">&lt;<a href="mailto:colin@wiresong.com" target="_blank">colin@wiresong.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Thu, Jan 9, 2014 at 2:01 AM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt;</span> wrote:<br>

<div> </div></div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Also, I prefer the lazy #or: over #|, because it&#39;s faster.</blockquote><div><br></div></div><div>Normally, yes, but in this case, I think #| is actually faster. Consider the two versions (without the bug):</div><div>
<br></div>
<div>a)  (lastObject == object) | (object == 0)</div><div><br></div><div>b) (lastObject == object) or: [object == 0]</div><div><br></div><div>Lazy evaluation doesn&#39;t help here, because the first comparison will almost never be true. On the other hand, #== is very fast, because it&#39;s a bytecode, whereas #or: involves an extra message send and creating a stack frame to execute the block.</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>Colin</div><div><br></div></font></span></div></div></div></blockquote><div>err, yes, lazyness don&#39;t pay, but no, #or: is inlined by compiler as a conditional jump...<br></div><div>It&#39;s the contrary, #| is a message send. <br>
</div></div><br></div></div>