[Cuis-dev] Thoughts about symbols

Juan Vuletich juan at cuis.st
Fri Nov 29 04:50:02 PST 2024


Hi Folks,

On 11/29/2024 6:10 AM, Hernán Wilkinson via Cuis-dev 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.

No, that was true for the previous two Character classes.

We could think about unifying stuff and having only a (Unicode)String 
and a (Unicode)Symbol classes. We'd need to check the VM, and maybe make 
some tweaks for this to work. So far, I don't see the need. The current 
design works quite well. Only when interfacing with the VM or FFI 
programmers need to be aware of having two String and two Symbol 
classes. During image level Smalltalk development, polymorphism does its 
magic for us, just like it does for the six concrete Number classes we use.

>  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 ==
>
> Cheers!
> Hernan.
>
>
> On Fri, Nov 29, 2024 at 4:28 AM Luciano Notarfrancesco via Cuis-dev 
> <cuis-dev at lists.cuis.st <mailto: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 <mailto:Cuis-dev at lists.cuis.st>
>     https://lists.cuis.st/mailman/listinfo/cuis-dev
>
>
>
> -- 
> *Hernán Wilkinson
> Agile 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

Thanks,

-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20241129/e706b4e9/attachment.htm>


More information about the Cuis-dev mailing list