[squeak-dev] isKindOf: in Morphic code...

Eliot Miranda eliot.miranda at gmail.com
Mon Jul 4 20:44:35 UTC 2016


Hi All, Hi Marcel,

    when I see code like this, and there's a lot of it in Morphic,

!Flaps class methodsFor: 'testing' stamp: 'mt 5/17/2016 14:17'!
anyFlapsVisibleIn: aWorld

        aWorld submorphsDo: [:m |
                (m isKindOf: FlapTab) ifTrue: [^ true]].

        ^ false! !

I think this is performance thrown on the floor (isKindOf: is awfully slow,
especially in huge hierarchies like Morphic, and bad design, restricting
one to a concrete class).  And I think that Morph provides a perfect place
to put an extension that doesn't pollute Object.  So I would like to see

anyFlapsVisibleIn: aWorld

        aWorld submorphsDo:
               [:m| m isFlapTab ifTrue: [^true]].
        ^ false! !

with the emphasis on isFlapTab ;-)

_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160704/33377425/attachment.htm


More information about the Squeak-dev mailing list