string sharing (possible bug?)
Adam P. Jenkins
ajenkins at javanet.com
Wed Dec 9 16:30:38 UTC 1998
Thank you very much to everyone who answered this question. I'm amazed, I
just asked this question half an hour ago and got three replies already.
To summarize the answers: Yes, Smalltalk does arrange to share literals at
the method level, so the behaviour I noticed was correct. And yes, it is a
good idea not to modify objects created from literals, but instead to make a
copy of them if they might be modified. In fact it would probably be a good
idea if the Smalltalk system itself didn't allow literals to be modified.
Someone pointed out that VisualAge does just that.
Thanks again,
Adam
More information about the Squeak-dev
mailing list
|