<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Btw, this won&#39;t work, because this expression is evaluated as<br>
<br>
        ((lastObject == object) | object) == 0<br>
<br>
which should raise an error, because most objects don&#39;t understand #|.<br>
Also, I prefer the lazy #or: over #|, because it&#39;s faster.</blockquote><div><br></div><div>You&#39;re right, it&#39;s a bug, but it does work, accidentally. It ends up going like this:</div><div><br></div><div>1. lastObject == object -&gt; aBoolean</div>
<div>2. aBoolean | object -&gt; true or object</div><div>3a. true == 0 -&gt; false</div><div>3b. object == 0 -&gt; true or false</div><div><br></div><div>For all objects except the sentinel object, we end up at 3b, and since #nextObject answers 0 when the receiver is the last object in the heap, we end up with the correct semantics. </div>
<div><br></div><div>However, it defeats the purpose of the sentinel object, which is to avoid an infinite loop caused by new block contexts being allocated when the block is executed. The reason I needed this change in the first place is that I was getting an error because SmallInteger shouldn&#39;t implement #nextObject. So somehow we were getting to the end of the heap without encountering the sentinel. </div>
<div><br></div><div>So I have two questions:</div><div><br></div><div>1) Why isn&#39;t the sentinel object enumerated in a shrunken image?</div><div>2) Why don&#39;t we get an infinite loop when we don&#39;t check for the sentinel?</div>
<div><br></div><div>Colin</div></div></div></div>