<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2014/1/12 David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Sun, Jan 12, 2014 at 10:50:03AM -0500, Colin Putney wrote:<br>
&gt; That diff is a bit hard to read, so here&#39;s the implementation:<br>
&gt;<br>
&gt;<br>
&gt; allObjectsDo: aBlock<br>
&gt; &quot;Evaluate the argument, aBlock, for each object in the system<br>
&gt; excluding SmallIntegers. New objects created by aBlock will<br>
&gt; be included in the enumeration, and it is up to the caller to avoid<br>
&gt; creating new objects faster than they are enumerated. It&#39;s<br>
&gt; important that the next object is fetched before the block is<br>
&gt; evaluated, because the block may use #become: to change the<br>
&gt; identity of object.&quot;<br>
&gt;<br>
&gt; | object nextObject |<br>
&gt; object := self someObject.<br>
&gt; [nextObject := object nextObject.<br>
&gt; aBlock value: object.<br>
&gt; object := nextObject.<br>
&gt; 0 == nextObject]<br>
&gt; whileFalse.<br>
&gt;<br>
&gt;<br>
&gt; This version has the following properties:<br>
&gt;<br>
&gt; - objects created inside the block will be enumerated<br></div></div></blockquote><div><br></div><div>I wonder in which case we&#39;d want to do that?<br></div><div>I mean that it&#39;s difficult to fully manage (absence of) object creation.<br>
</div><div>Especially if we insert lazy behaviors which rely on some sort of proxy (like in Xtreams).<br></div><div>allObjectsThatExistAtThisPointInTimeDo: is a reasonable behavior IMO.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">
&gt; - callers may use become inside the block<br>
&gt; - callers must avoid infinite loop<br>
&gt;<br>
&gt; I think these are the most desirable semantics for #allObjectsDo:. However,<br>
&gt; the risk with this implementation is that it will execute an infinite loop<br>
&gt; on VMs that create a new context object for each block activation. Cog and<br>
&gt; the StackVM don&#39;t, but John&#39;s Mac VM 5.7.4.1 does, according to a quick<br>
&gt; test I just did. I don&#39;t know what the behaviour of older Window and Linux<br>
&gt; VMs are.<br>
&gt;<br>
&gt; So  the question is, what VMs are we planning to support for in 4.5, and do<br>
&gt; they recycle activation contexts?<br>
&gt;<br>
<br>
</div></div>Certainly the up to date interpreter VM and Cog/StackInterpreter will be<br>
used, but I think that there are some folks who still need to use John&#39;s<br>
Mac VM, so it would be good if we could find a solution that works there<br>
also.<br>
<br>
But I also like your implementation here, it&#39;s simple and easy to understand.<br>
<br>
Dave<br>
<br>
<br>
</blockquote></div><br></div></div>