On Dec 24, 2007 4:24 PM, Chris Cunnington cunnington@sympatico.ca wrote:
I've never used #respondsTo:.
I tried this:
Object respondsTo: asMorph
I print it, and get:
Object respondsTo: asMorph false
I thought this was a way of asking any object in the system if it has a certain method. How should I use respondsTo:? It's probably a beginner question, but, hey. That's me.
It should be "Object respondsTo: #asMorph". But in fact, you can say "3 respondsTo: #asMorph". The reason that the first works is that Object is an instance of a subclass of Object. #asMorph is a message you send to instances, not classes.
-Ralph Johnson