Unique all characters?

nicolas cellier ncellier at ifrance.com
Tue Jan 29 18:38:53 UTC 2008

nicolas cellier a écrit :
> Yoshiki Ohshima a écrit :
>>   Eliot,
>>> (Alternatives that are indexed by integers might also work well, e.g. 
>>> a flat WeakValueDictionary that used a WeakArray
>>> for its values).
>>   Yes, there would be no reason to do basicNew.
>>   But I need to ask the same question Colin asked; what would we gain?
>> For most of the time, characters are in strings so there are not many
>> real instances around.  For writing a parser (hmm) it might make
>> things a bit faster, but not much.
>>   Tagged immediate character objects would have been ok (like
>> VisualWorks), but it puts some pressure on integers...
> Sure, 1 bit less.
> This has to be thought again when 64 bits Squeak will spread.
> Nicolas

But we do not need to reserve two tag bits for every case:

xxx..xxx1 is a SmallInteger on 31 bits
xxx..xx10 is a Character
xxx..xx00 is an OOP

This does not put pressure on integer


More information about the Squeak-dev mailing list