[Glass] Differences between Symbol/String #= in Pharo and GemStone
jtuchel at objektfabrik.de
jtuchel at objektfabrik.de
Mon Dec 9 02:05:27 PST 2013
Am 09.12.13 07:09, schrieb itlists at schrievkrom.de:
>
> Pharo:
>
> 'aaa' asSymbol -> #aaa
> #aaa = 'aaa' -> true
> This seems to be a very strange result
>
> Marten
Hi Marten,
that also was my first thought. But thinking about it, the difference in
class between a Symbol and a String is quite technical, so you can argue
that #aaa and 'aaa' are equal. They represent the same sequence of
characters, even if, technically, a Symbol is only a unique name for an
entry in some special list.
Still this behavior is not the default outside of Pharo, and as Dale
says, it's not standards compliant.
So Mariano, I guess you should try and find another solution. I guess
neither String nor Symbol are the best possible choices as Dictionary
keys if you want to do fast and *unique* lookups, even if that sounds
strange for Symbols... What exactly was your intention for Symbols? I
guess it was guaranteed uniqueness, right?
Joachim
--
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel mailto:jtuchel at objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
More information about the Glass
mailing list