[Cuis-dev] Uniqueness of Characters (Related to NeoCSV)

Hernán Wilkinson hernan.wilkinson at 10pines.com
Sun Jul 23 19:39:18 PDT 2023


I think we should keep it the way it is right now and fix the problems when
they arise.
The message #== should only be used when doing meta-programming of memory
stuff related, if not, #= is the right one to use.
There is a lot of old code that uses #== instead of #=, most of it due to
"performance" reasons, other due to "ignorance", (new smalltalkers confuse
== with equality because Java/C#/etc use #== as equality (or message
equals) and #= as assignment, etc.
 The truth is that, currently, the impact on performance is negligible
(performance problems are not due to use #= instead of #==). Using #==
instead of #= because a possible performance issue is an early optimization
and we all know that "early optimization is the root of all evil" :-)

Cheers!
Hernan.

On Sun, Jul 23, 2023 at 5:05 PM Juan Vuletich <juan at cuis.st> wrote:

> 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
>
>

-- 

*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/20230723/0cabf4bf/attachment.htm>


More information about the Cuis-dev mailing list