Messages to "super"

Martin Drautzburg martin.drautzburg at web.de
Fri Aug 29 18:32:40 UTC 2003


I thought I knew it all, but ...

I created the following class

        Object subclass: #Foo ...
        bar
                ^ self

When I create aFoo and inspect it, it answers true to both
        self respondsTo: #bar and
        super respondsTo: #bar 

also I get Foo no matter if I ask
        self class or
        super class

Can someone explain ?

The reason why I was doing this, was in a #mouseDown method I thoght
I'd invoke mouseDown on super if it came from a mouse button I didn't
handle. But since I didn't know if the superclass has a #mouseDown
method at all I tried to figure that out by sending a #respondsTo:




More information about the Squeak-dev mailing list