define_method/3
define_method(
+Obj,
+Message,
+Body)
Install 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
type_error
domain_error
instance_method/1
, undefine_method/3