Image format proposals... Re: [SqF]Report of VI4 Project for Feb '02

Lex Spoon lex at cc.gatech.edu
Sat Feb 2 23:46:13 UTC 2002


> I'd like to have a bit in the object header for the purpose of 
> marking an object immutable.
> 
[...]
> Usefulness:
> There are two basic classes of uses for this capability.
> 1) Preventing the modification of an object
> 2) Detecting the modification of an object
> 
> Some objects just shouldn't be modified -- Symbols, method literals, etc.
> 

For this particular purpose, you can don't need an immutable bit, and
I'm not sure it really helps.  I've actually gone through and made such
things as immutable as makes sense for Smalltalk, and it only required
being careful about what methods were available.  (Well, and I added a
new debugger-level primitive for modifying instance variables of an
object other the receiver.  That is, instead of instVarAt:put:, it was
instVarOf:at:put:.).  It's more flexible to do it this way, anyway,
because you can code the methods to be partially restrictive if you
want.  In fact, it's what we already do with methods, anyway --
sometimes a method will respond with "No".


For a persistence framework, etc., I have no idea.



-Lex



More information about the Squeak-dev mailing list