RespondsTo

bool RespondsTo(heapPtr anObject, selector aSelector)

Checks to see if the object will respond to the specified selector (property or method). Call this before calling an object's method or accessing an object's property if you are unsure if the object actually contains it.

It returns TRUE if the object does respond to the selector, otherwise, FALSE.

Example
(if(RespondsTo(someObject #doit))
    (
send someObject:doit())
)
(
if(RespondsTo(someObject #text))
    (
send someObject:text("Hello world!"))
)