[Cuis-dev] Uniqueness of Characters (Related to NeoCSV)
Juan Vuletich
juan at cuis.st
Sun Jul 23 13:04:48 PDT 2023
Hi Folks,
Hilaire had trouble, that he already solved, when updating NeoCSV for
current Cuis. The root of the problem is that in older Cuis and in
Smalltalk-80 and Squeak `aCharacter == $,` is guaranteed to mean the
same as `aCharacter = $,`. In other words, there can exist only one
instance of any Character. This is no longer in true today in Cuis: `$,
== $, asUnicodeCodePoint` is false.
In Cuis we have two character like classes. They are polymorphic, and
the only observable difference is when asking #== or #identityHash.
The question I ask is: How important is this? Do we need or want
uniqueness of characters? What do other dialects do? Would it make sense
to give an error or at least a warning when trying to compare with #==
against a literal character?
It is possible to guarantee uniqueness of characters, but not without
some work. The easiest way is what Squeak did, having a single, Unicode
wide, immediate Character class. But this can not be done in pre-Spur
(V3) images and VMs.
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
More information about the Cuis-dev
mailing list