<div dir="ltr">Hi Luciano,<div> 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.</div><div><br></div><div> 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 == </div><div><br></div><div>Cheers!</div><div>Hernan.</div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Nov 29, 2024 at 4:28 AM Luciano Notarfrancesco via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div>
<p dir="auto">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.<br></p>
<p dir="auto">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?</p>
</div>
</div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="font-size:small"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal"><span style="font-weight:bold">Hernán Wilkinson</span><br>Agile Software Development, Teaching & Coaching</span></font></span></span></strong></span></div><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div style="font-size:12.8px"><strong style="font-family:tahoma,sans-serif;font-size:xx-small"><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Twitter: @HernanWilkinson</span></font></span></span></strong></div><div style="font-size:12.8px"><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">site: <a href="http://www.10pines.com/" style="color:rgb(17,65,112)" target="_blank">http://www.10Pines.com</a></span></font></span></span></strong></span></div><div style="font-size:12.8px"><font face="tahoma, sans-serif"><span style="border-collapse:collapse">Address: Alem 896</span></font>, Floor 6, Buenos Aires, Argentina</div></div></div></div></div></div></div></div>