Miranda respondsTo

From Erights

Jump to: navigation, search

__respondsTo/2 is a Miranda message for asking whether an object understands a message.

__respondsTo/2

Signature: __respondsTo(verb :Verb, arity :(int > 0)) :boolean

Returns a boolean indicating whether this object responds to messages with the verb verb and arity (number of arguments) arity.

The Miranda method for E-language objects is:

  1. If this object has a method with the given verb and arity, return true.
  2. If there is a Miranda method with the given verb and arity, return true.
  3. If the object has a matcher, return the result of invoking the matcher with the __respondsTo message. If the matcher does not match, return false.
  4. Return false.

XXX confirm this is an accurate description of current behavior.

Personal tools
more tools