[Cuis-dev] Thoughts about symbols

Luciano Notarfrancesco luchiano at gmail.com
Fri Nov 29 03:33:42 PST 2024


On Fri, Nov 29, 2024 at 18:10 Hernán Wilkinson <hernan.wilkinson at 10pines.com>
wrote:

Hi Luciano,
 I think that makes sense from the design point of view but if I'm not
wrong, those two classes are just an intermediate step to the final design
where only one will exist ... I think Juan knows better about this.


Ah, I should have guessed, thanks.

There is another thing I'd like to talk about because you use the word
equality to reference == and I use the word identity... for me == means
"identical object" and = means "objects that represent the same entity"
(when I say "means", I should say "are used to know if ..." )... anyway,
just a comment because it "surprised" that you used the word equality for
==


Yes, I usually call it identity in Smalltalk, but I was thinking more in a
mathematical context, and emphasizing that for symbols equality is identity.

Thanks!
Luciano




> Cheers!
> Hernan.
>
>
> On Fri, Nov 29, 2024 at 4:28 AM Luciano Notarfrancesco via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> If we think of == as equality, and = as an equivalence relation, the
>> Symbol #xxx is just the equivalence class of all Strings ‘xxx’, and any
>> String instance ‘xxx’ is a representative of that equivalence class. This
>> construction is useful if you need to use objects under equality = in a
>> context where equality is == (for example, keys of an IdentityDictionary).
>> And, an IdentityDictionary with Symbols as keys is just like a Dictionary
>> with Strings as keys. So, from this point of view, a symbol should be all
>> about equality, about = and #hash.
>>
>> Now, in Cuis we have two parallel symbol classes depending on the type of
>> characters in their names: Symbol and UnicodeSymbol. Would it be better to
>> replace this with a single and more general Symbol with an instance
>> variable ‘representative’, that can be a String, or a UnicodeString (or
>> possibly any object)? What do you think?
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
>
>
> --
>
> *Hernán WilkinsonAgile Software Development, Teaching & Coaching*
> *Phone: +54-011*-4893-2057
> *Twitter: @HernanWilkinson*
> *site: http://www.10Pines.com <http://www.10pines.com/>*
> Address: Alem 896, Floor 6, Buenos Aires, Argentina
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20241129/62226ee4/attachment-0001.htm>


More information about the Cuis-dev mailing list