uses/2

Description

uses(Object, Predicates)

Declares that all calls (made from predicates defined in the category or object containing the directive) to the specified predicates are to be interpreted as messages to the specified object. Thus, this directive may be used to simplify writing of predicate definitions by allowing the programmer to omit the Object:: prefix when using the predicates listed in the directive (as long as the predicate calls do not occur as arguments for user-defined metapredicates).

Template and modes

uses(+object_identifier, +predicate_indicator_list)

Examples

:- uses(list,
    [append/3, member/2]).

foo :-
    ...,
    findall(X, member(X, L), A),    % the same as: findall(X, list::member(X, L), A)
    append(A, B, C),                % the same as: list::append(A, B, C)
    ...