<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 1, 2014 at 5:15 PM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I took a quick look, and found two issues so far.<br>
<br>
Environment &gt;&gt; #bindingOf:ifAbsent: returns bindings from undeclared:<br>
<br>
bindingOf: aSymbol ifAbsent: aBlock<br>
        ^ bindings bindingOf: aSymbol ifAbsent:<br>
                [undeclared bindingOf: aSymbol ifAbsent: aBlock]<br>
<br>
This fools Shout and the rest of the system, making them &quot;think&quot; that any missing instance variable which has a method referencing it exists.<br>
A good example is Environment&#39;s exports variable, which was deleted, but the #exports accessor is still in the image, and it&#39;s referencing it. So I can compile any method using the exports variable, and neither Shout, nor the compiler will complain. This is the reason why ReleaseTest &gt;&gt; #testUndeclared is still failing.<br>
</blockquote><div><br></div><div><br></div><div>Argh. I keep making this mistake, because that&#39;s obviously how it should work. Of course, despite being obvious, this intuition is just wrong. I&#39;ve added some tests that should catch this sort of mistake in the future. </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there a reason to return bindings from Undeclared from #bindingOf:ifAbsent:?<br>
<br>
<br>
The other issue is related to the handling of Undeclared. Dictionary &gt;&gt; #unreferencedKeys - which is used during #cleanOutUndeclared - ignores the current Environment and uses the classes of the global environment.<br>

The Environment itself should provide a method to remove the unreferenced bindings from its own Undeclared.<br></blockquote><div><br></div><div>It does—#purgeUndeclared. We just need to send that message to the right environment. I suspect that senders of #cleanOutUndeclared should deprecated, and all the existing senders should be rewritten to send #purgeUndeclared to the appropriate environment.</div>
<div><br></div><div><br></div></div><br></div></div>