Logtalk reference manual
Control construct: :/1

:/1

Description

:Predicate

Calls an imported predicate with the lookup for the predicate declaration beginning in this instead of self and with the lookup for the predicate definition 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. The predicate is called with the same execution context (sender, this, and self) as the predicate whose body contains the call. When the predicate is defined in an imported category compiled using static binding, this control construct allows the predicate to be called with the same performance as a local object predicate.

Template and modes

:+callable

Errors

Predicate is a variable:
instantiation_error
Predicate is neither a variable nor a callable term:
type_error(callable, Predicate)
Predicate is not declared:
existence_error(predicate_declaration, Predicate)

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).