<div>Surely if you have a wrapper class which only holds a reference to a single object that has all of the data, and that has accessors, then the wrapper can only use the accessors? The data object could have a flag that causes all of the accessors to throw an exception when it is set. <br>
&nbsp;</div>
<div>Or am&nbsp;I missing something?<br>&nbsp;</div>
<div><span class="gmail_quote">On 10/2/08, <b class="gmail_sendername">Randal L. Schwartz</b> &lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">&gt;&gt;&gt;&gt;&gt; &quot;Sean&quot; == Sean Allen &lt;<a href="mailto:sean@monkeysnatchbanana.com">sean@monkeysnatchbanana.com</a>&gt; writes:<br>
<br>Sean&gt; If you wanted to take a mutable object and make it immutable and be able<br>Sean&gt; to go back again to mutable, how could you do that?<br><br>Squeak doesn&#39;t have that sort of capability.&nbsp;&nbsp;The immutability of a few<br>
classes is because the VM recognizes them specially, and not available<br>at the programmer level without modifying the VM.<br><br>Other Smalltalk VMs are different.&nbsp;&nbsp;I think both VisualWorks and GemStone/S<br>have primitive bits on an object to be informed when a mutation might be<br>
attempted.<br><br>You can simulate that *mostly* in Squeak by using a &quot;proxy&quot; object that<br>intercepts all messages and looks for the dangerous ones, but that&#39;s gonna be<br>a bit hard to do, and won&#39;t be aware of any new code that might call the<br>
mutating primitives directly.&nbsp;&nbsp;(*Any* method can call a primitive.)<br><br>--<br>Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095<br>&lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt; &lt;URL:<a href="http://www.stonehenge.com/merlyn/">http://www.stonehenge.com/merlyn/</a>&gt;<br>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.<br>See <a href="http://methodsandmessages.vox.com/">http://methodsandmessages.vox.com/</a> for Smalltalk and Seaside discussion<br>_______________________________________________<br>
Beginners mailing list<br><a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br>