<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 12.01.2014, at 18:40, Nicolas Cellier &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto;">
<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's the implementation:<br>
&gt;<br>
&gt;<br>
&gt; allObjectsDo: aBlock<br>
&gt; "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'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."<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'd want to do that?<br></div></div></div></div></blockquote><div><br></div><div>Me too. We want to enumerate all objects *created until* sending #allObjectsDo.</div><div><br></div><span style="font-size: 12px; orphans: 2; widows: 2;">- Bert -</span><div>.</div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I mean that it'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>&nbsp;<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't, but John's Mac VM 5.7.4.1 does, according to a quick<br>
&gt; test I just did. I don't know what the behaviour of older Window and Linux<br>
&gt; VMs are.<br>
&gt;<br>
&gt; So &nbsp;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'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's simple and easy to understand.<br>
<br>
Dave<br>
<br>
<br>
</blockquote></div><br></div></div>
<br></blockquote></div><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; font-family: 'Lucida Grande'; font-size: 12px;"><br class="Apple-interchange-newline"></span>

</div>
<br></body></html>