[Newbies] 'locking' an object

Sean Allen sean at monkeysnatchbanana.com
Thu Oct 2 15:50:01 UTC 2008

If you wanted to take a mutable object and make it immutable and be  
able to go back again to mutable,
how could you do that?

In particular the part that has me as a smalltalk beginner stumped is  
how to disallow any messages
that would result in a state change while still allowing messages that  
only read state.

Do you have to handle on a message by message basis? ( Eeek lots and  
lots of work )
Or is there something you could work into a superclass and use in its  
descendents? ( ideal for what I need. )

More information about the Beginners mailing list