[Cuis-dev] [Fix] Duplicated code in #isKindOf:
Juan Vuletich
juan at cuis.st
Tue Jan 6 11:02:20 PST 2026
Integrated. Thanks!
Cheers,
On 2026-01-06 2:11 PM, Nicolás Papagna Maldonado via Cuis-dev wrote:
> 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
>
--
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260106/ffb490fd/attachment.htm>
More information about the Cuis-dev
mailing list