On Feb 19, 2008, at 10:53 , Marcin Tustin wrote:

Re-initialize how? I can't see a way to run object initialisation over again on an existing object.


Everything in Smalltalk happens by sending a message. How was your object initialized? By sending a message. How can you initialize it again? Send the message again.

Case in point - OrderedCollection. How is it initialized? Look at #new:. It sends #setCollection:. So send #setCollection: with a new Array and you're done.

Well, of course you're not *supposed* to be doing this. But you could, and it would only be half-evil ;)

- Bert -


_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to