[Glass] Differences between Symbol/String #= in Pharo and GemStone

Philippe Marschall philippe.marschall at gmail.com
Sun Dec 8 23:06:11 PST 2013


On Mon, Dec 9, 2013 at 2:46 AM, Mariano Martinez Peck
<marianopeck at gmail.com> wrote:
> HI guys,
>
> I have this difference:
>
> Pharo:
>
> 'aaa' asSymbol -> #aaa
> #aaa = 'aaa' -> true
>
> GemStone
>
> 'aaa' asSymbol -> #'aaa'
> #aaa = 'aaa' -> false
>
> That doesn't look like a big difference, but it is for me! One of the
> reasons is that I have several dictionaries in which I have strings which
> are stored as symbols...this is usually to save space, make the lookup
> faster or some other reason.

Did you actuall benchmark this? #asSymbol does a look up in the symbol
dictionary so if anything I would expected it to make your look up
slower. And you fill up the symbol dictionary.

Cheers
Philippe


More information about the Glass mailing list