[Cuis-dev] [Fix] Duplicated code in #isKindOf:

Nicolás Papagna Maldonado nicolas.papagna at gmail.com
Tue Jan 6 09:11:28 PST 2026


Hi folks,

I noticed that the current implementation of Object>>#isKindOf: is a
duplication of Behavior>>#includesBehavior:

*Object>>#isKindOf: aClass *
  "Answer whether the class, aClass, is a superclass or class of the
receiver."

  self class == aClass
    ifTrue: [^true]
    ifFalse: [^self class inheritsFrom: aClass]

*Behavior>>#includesBehavior: aClass*

  ^self == aClass or:[self inheritsFrom: aClass]

The attached changeset implements #isKindOf: using #includesBehavior: to
remove the duplicated code.

Best,
Nico PM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260106/3fd3ae19/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7784-RemoveDuplicationInIsKindOf-NicolasPapagnaMaldonado-2026Jan06-11h26m-NPM.001.cs.st
Type: application/octet-stream
Size: 289 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260106/3fd3ae19/attachment.obj>


More information about the Cuis-dev mailing list