Object::Message {Proxy}::Message
Sends a message to an object. The message argument must match a public predicate of the receiver object. When the message corresponds to a protected or private predicate, the call is only valid if the sender matches the predicate scope container. When the predicate is declared but not defined, the message simply fails (as per the closed-world assumption).
The {Proxy}::Message
syntax allows simplified access to parametric object proxies. Its operational semantics is equivalent to the goal conjunction (call(Proxy), Proxy::Message)
. I.e. Proxy
is proved within the context of the pseudo-object user
and, if successful, the goal term is used as a parametric object identifier. Exceptions thrown when proving Proxy
are handled by the ::/2
control construct. This syntax construct supports backtracking over the {Proxy}
goal.
The lookups for the message declaration and the corresponding method are performed using a depth-first strategy. Depending on the value of the optimize
flag, these lookups are performed at compile time whenever sufficient information is available. When the lookups are performed at runtime, a caching mechanism is used to improve performance in subsequent messages.
+object_identifier::+callable {+object_identifier}::+callable
instantiation_error
type_error(object_identifier, Object)
type_error(callable, Message)
permission_error(access, private_predicate, Functor/Arity)
permission_error(access, protected_predicate, Functor/Arity)
existence_error(predicate_declaration, Functor/Arity)
existence_error(object, Object)
instantiation_error
type_error(object_identifier, Proxy)
existence_error(procedure, ProxyFunctor/ProxyArity)
| ?- list::member(X, [1, 2, 3]). X = 1 ; X = 2 ; X = 3 yes