If I take a class, any class, and say
ThisClass canUnderstand: #classCompilerClass (or any other method defined in Class/ClassDescription/Behavior)) Does it answer "false" -- when in fact I CAN send "classCompilerClass" to the class?? I know technically why, I just don't know why it SHOULD be that way??? -- Dennis Smith +1 416.798.7948 Cherniak Software Development Corporation Fax: +1 416.798.0948 509-2001 Sheppard Avenue East [hidden email] Toronto, ON M2J 4Z8 sip:[hidden email] Canada http://www.CherniakSoftware.com Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Dennis,
#canUnderstand: is a message send to a class, and tells you whether all of its instances respond to a particular message. #respondsTo: is a message sent to an instance, and tells you whether that instance will respond to a particular message. So... 5 canUnderstand: #+ --> false 5 class canUnderstand: #+ --> true 5 respondsTo: #+ --> true Similarly, in your example, ThisClass canUnderstand: #classCompilerClass --> false ThisClass respondsTo: #classCompilerClass --> true thisClass class canUnderstand: #classCompilerClass --> true The names are unfortunately cryptic, but that is what they mean. -anthony On 10-May-21, at 3:50 PM, Dennis Smith wrote: > If I take a class, any class, and say > > ThisClass canUnderstand: #classCompilerClass > > (or any other method defined in Class/ClassDescription/Behavior)) > Does it answer "false" -- when in fact I CAN send "classCompilerClass" > to the class?? > > I know technically why, I just don't know why it SHOULD be that way??? > > -- > Dennis Smith +1 416.798.7948 > Cherniak Software Development Corporation Fax: +1 416.798.0948 > 509-2001 Sheppard Avenue East [hidden email] > Toronto, ON M2J 4Z8 sip:[hidden email] > Canada http://www.CherniakSoftware.com > Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Dennis smith-4
On 5/21/10 12:50 PM, Dennis Smith wrote:
> If I take a class, any class, and say > > ThisClass canUnderstand: #classCompilerClass > > (or any other method defined in Class/ClassDescription/Behavior)) > Does it answer "false" -- when in fact I CAN send "classCompilerClass" > to the class?? > > I know technically why, I just don't know why it SHOULD be that way??? > > this message" so while ThisClass classCompilerClass does work, ThisClass basicNew classCompilerClass does not. ThisClass class canUnderstand: #classCompilerClass is the question you should be asking, or: ThisClass respondsTo: #classCompilerClass Michael _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Everyone is correct -- sorry about that.
canUnderstand applies to the instances and NOT the class -- On 5/21/2010 4:42 PM, Michael Lucas-Smith wrote: > On 5/21/10 12:50 PM, Dennis Smith wrote: > >> If I take a class, any class, and say >> >> ThisClass canUnderstand: #classCompilerClass >> >> (or any other method defined in Class/ClassDescription/Behavior)) >> Does it answer "false" -- when in fact I CAN send "classCompilerClass" >> to the class?? >> >> I know technically why, I just don't know why it SHOULD be that way??? >> >> >> > #canUnderstand: answers the question "will instances of me understand > this message" > so while ThisClass classCompilerClass does work, ThisClass basicNew > classCompilerClass does not. > > ThisClass class canUnderstand: #classCompilerClass is the question you > should be asking, or: > ThisClass respondsTo: #classCompilerClass > > Michael > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > -- Dennis Smith +1 416.798.7948 Cherniak Software Development Corporation Fax: +1 416.798.0948 509-2001 Sheppard Avenue East [hidden email] Toronto, ON M2J 4Z8 sip:[hidden email] Canada http://www.CherniakSoftware.com Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |