Logtalk reference manual
Predicate directive: protected/1

protected/1

Description

protected(Functor/Arity)
protected(Functor1/Arity1, Functor2/Arity2, ...)
protected([Functor1/Arity1, Functor2/Arity2, ...])

protected(Functor//Arity)
protected(Functor1//Arity1, Functor2//Arity2, ...)
protected([Functor1//Arity1, Functor2//Arity2, ...])

Declares protected predicates and protected grammar rule non-terminals. A protected predicate can only be called from the object containing the directive or from an object that inherits the directive. A protected non-terminal can only be used as an argument in a phrase/2 and phrase/3 messages sent from the object containing the directive or from an object that inherits the directive.

Template and modes

protected(+predicate_indicator_term)
protected(+non_terminal_indicator_term)

Examples

:- protected(init/1).

:- protected(print/2, convert/4).

:- protected([load/1, save/3]).