[Cuis-dev] smalltalk newbie - Complex

Jon Raiford raiford at labware.com
Sun Sep 28 05:11:54 PDT 2025


I didn't notice anyone else pointing this out... Have a look at how many "is" methods are defined on Object in Cuis. Although it is a very common pattern in Smalltalk, in Cuis this was changed slightly. Yes, there are some common is methods like isString (and isComplex), but there is also the #is: method. The idea is to only implement #is: on your classes that should answer true. Have a look at implementors and senders to understand how it's implemented and used. I believe the purpose of this is to help prevent packages from adding methods to Object unnecessarily.

Jon



From: Cuis-dev <cuis-dev-bounces at lists.cuis.st> on behalf of Jonathan Kelly via Cuis-dev <cuis-dev at lists.cuis.st>
Date: Friday, September 26, 2025 at 8:31 PM
To: cuis-dev at lists.cuis.st <cuis-dev at lists.cuis.st>
Cc: Jonathan Kelly <jonkelly at fastmail.fm>
Subject: [Cuis-dev] smalltalk newbie - Complex

Hi,

I'm playing with Cuis smalltalk, and building a Complex class, so far so
good. But I want to add an  "isComplex" method on Object, and
an  "asComplex" method on Number, but I can't find a way to tell Cuis
that the new methods belongs to the Complex package.How do I make all my
changes belong to the Specific package they're related to?

Thanks

Jon

--
Cuis-dev mailing list
Cuis-dev at lists.cuis.st
https://lists.cuis.st/mailman/listinfo/cuis-dev<https://lists.cuis.st/mailman/listinfo/cuis-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250928/5559efeb/attachment.htm>


More information about the Cuis-dev mailing list