string sharing (possible bug?)

Blanchard, Tod tod.blanchard at
Thu Dec 10 02:37:13 UTC 1998

Its a policy thing.  Think about it and work out your policy.

When I was a VW developer we always initialized potentially mutable strings
like this:

s1 := String new: 'abc'. (which I don't see in String in squeak....add it in
a second though)
s2 := ('abc' copy).

Todd Blanchard

> -----Original Message-----
> From:	C. Keith Ray [SMTP:ckray at]
> Sent:	Wednesday, December 09, 1998 6:23 PM
> To:	squeak at
> Subject:	RE: string sharing (possible bug?)
> on 12/09/1998 01:07 PM, glenn krasner at wrote:
> >>The simplest method is to just create a new object every time a
> >>literal is encountered.
> >
> >And, for example in the case of our window builder, suffer a large
> >performance penalty every time you open a window. And that penalty would
> be
> >paid by everyone just so that the few people who accidentally store into
> a
> >literal array or string would have a better time of it. That's not the
> >tradeoff we decided to make, and I suspect that this would also be a
> worse
> >choice for Squeak.
> >
> >If this upsets your sensibilities ("Yuck" is a clue), I think you're more
> >likely to find a better path by making immutability cheap in Squeak, than
> >by removing compile-time literal construction.
> Is this the window builder in Squeak? Has this penalty been measured?
> C. Keith Ray                  ckray at
> Sr. Software Engineer         408-341-1800 x 242
> Pixera Corp.        

More information about the Squeak-dev mailing list