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

Sebastian Heidbrink sebastian_heidbrink at yahoo.de
Mon Dec 9 06:35:33 PST 2013


Hi Mariano,

having/handling one and the same String instance can be achieved by 
using CanonicalStringDictionary and/or CanonStringDict

Maybe you should have a look into their class comments.

Sebastian

Am 09.12.2013 02:05, schrieb jtuchel at objektfabrik.de:
> 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
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20131209/d7fc4ff2/attachment-0001.html>


More information about the Glass mailing list