Next: obj-exp-descendant_of, Previous: obj-exp-debug_message, Up: obj-exp [Contents][Index]
define_method/3
define_method(+Obj, +Message, +Body)
object
term
callable
Installs Body as the method for Message
in the instance Obj. Following the execution of this goal,
sending Message to Obj will execute Body, rather than the
default method or a method previously defined with
define_method/3
.
Message must have been declared to be an instance method for the class of Obj.
instantiation_error
any argument is unbound.
type_error
Obj is not a compound term, or Message or Body is not callable.
domain_error
Message does not specify an instance method for the class of Obj, or Body include a goal to fetch or store a non-existent slot.
instance_method/1
, undefine_method/3