<br>
<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It's not about how temps work, it's about how literals work.&nbsp;&nbsp;When an<br>expression like #(nil) is compiled, a new Array object is created and
<br>stored in the CompiledMethod object.&nbsp;&nbsp;Every time you invoke the<br>method, that same instance gets used.&nbsp;&nbsp;This is different from {nil},<br>which creates a new Array every time, or [nil], which creates a new<br>BlockContext every time.
<br><br>So effectively the cache is inside the CompiledMethod object itself;<br>if you change the source and recompile, the cache will get wiped out<br>(which is exactly what you want).</blockquote><div><br>
Pretty freaky!&nbsp; I never cease to be amazed by this super cool
programming environment. You are right! What a handy dandy trick. I
wonder if that is an implementation feature of Squeak or if all
Smalltalks exhibit that behavior. Anyways, I updated InstanceEncoder on
SqueakMap with your caching optimization. Thanks for providing
explanation of the technique.<br>
<br>
Regards,<br>
<br>
John<br>
</div><br></div><br>-- <br>It's easy to have a complicated idea. It's very very hard to have a simple idea. -- Carver Mead