[Cuis-dev] smalltalk newbie - Complex

Juan Vuletich juan at cuis.st
Tue Sep 30 04:19:50 PDT 2025


On 29/09/2025 6:23 PM, Jonathan Kelly via Cuis-dev wrote:
>
> I had a look at Object>>#is: and was thinking, how does that help?? A 
> little later, looking at isFloatOrComplex - which was puzzling me as 
> Kernel doesn't have Complex(?) - something clicked and I went "Oh. 
> Nice!". Going back now to get rid of my Object>>isComplex.
>
> re isFloatOrComplex ... I assume that means that Complex was, at some 
> point, part of the Kernel?
>
> Jonathan
>

I believe it was.

But that's not the reason for #isFloatOrFloatComplex and #isComplex. 
#floatErrorValue and it sender seemed to me like a reasonable tradeoff 
to get the very different behavior of `1 / 0` and `1.0 / 0.0`, and of `1 
+ 1 i / 0` and `1.0 + 1.0 i / 0.0`. Making the base image absolutely 
ignorant of Complex would have made that code more complicated.

There's not always a certain 'best' solution, and sometimes it is a 
matter of style. Everything is open for improvement, of course.

Thanks,

-- 
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich



More information about the Cuis-dev mailing list