Changing strings

Joern Eyrich Joern.Eyrich at syngenio.de
Sun Apr 21 22:24:30 UTC 2002


jennyw wrote:
> 
> [...] It seems that literal strings, like symbols,
> are unique?

I think it's like this:

If you use the same literal more than once in a method (or a workspace snippet), it will only be put once into the CompiledMethod's literal frame, so it's basically the same object each time you use it *in that method*.

If, however, you use it in different methods, they will be different objects.

So if you execute your two lines in different methods in a class with an instance variable a, the second one will not touch the instvar

> a := 'squeak'.
> 'squeak' at: 6 put: $l.



More information about the Squeak-dev mailing list