Testing Whether an Object Responds to a Method Call
<< previous | Chapter 7. Interactions Between Agents | next >>

## Testing Whether an Object Responds to a Method Call

If you need to know whether an item can respond to a certain method call, use the method can-respond in Object.tz. As with is, this method is used like a statement that returns true or false:

        if (item can-respond to "sing-and-dance"): item sing-and-dance.

<< previous | Up | next >>
Finding All Objects of a Given Type | Table of Contents | Testing the Type of an Object