<</2¶
Description¶
Object<<Goal
{Proxy}<<Goal
Debugging control construct. Calls a goal within the context of the
specified object. The goal is called with the execution context
(sender, this, and self) set to the object.
The goal may need to be written between parenthesis to avoid parsing
errors due to operator conflicts. This control construct should only be
used for debugging or for writing unit tests. This control construct can
only be used for objects compiled with the
context_switching_calls compiler
flag set to allow
. Set this compiler flag to deny
to disable
this control construct and thus preventing using it to break encapsulation.
The {Proxy}<<Goal
syntax allows simplified access to
parametric object proxies.
Its operational semantics is equivalent to the goal conjunction
(call(Proxy), Proxy<<Goal)
. 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.
Caveat: although the goal argument is fully compiled before calling, some necessary information for the second compiler pass may not be available at runtime.
Modes and number of proofs¶
+object_identifier<<+callable - zero_or_more
{+object_identifier}<<+callable - zero_or_more
Errors¶
instantiation_error
type_error(object_identifier, Object)
type_error(callable, Goal)
existence_error(procedure, Goal)
existence_error(object, Object)
permission_error(access, database, Goal)
instantiation_error
type_error(object_identifier, Proxy)
existence_error(procedure, ProxyFunctor/ProxyArity)
Examples¶
% call the member/2 predicate in the
% context of the "list" object:
test(member) :-
list << member(1, [1]).