Logtalk reference manual
Control construct: :/1

:/1

Description

:Goal

Calls an imported category predicate without using the message sending mechanisms. The category predicate is called with the same execution context (sender, this, and self) as the predicate whose body contains the call. The lookup for both the predicate declaration and the predicate definition begins in this. For the predicate definition, the lookup is restricted to the imported categories. As a consequence, any redeclaration or redefinition of the predicate in a descendant of the object containing the call will be ignored.

Template and modes

:+callable

Errors

Goal is a variable:
instantiation_error
Goal is neither a variable nor a callable term:
type_error(callable, Goal)
The object containing the call does not import any category:
existence_error(procedure, Goal)

Examples

:- object(bounded_point,
    imports(bounded_coordinate),
    instantiates(class),
    specializes(point)).

    move(X, Y) :-
        :check_bounds(x, X),    % defined in the "bounded_coordinate" category
        :check_bounds(y, Y),
        ^^move(X, Y).