[ Predicate Database and Compiler | Reference Manual | Alphabetic Index ]

deprecated(++PredSpec, +Advice)

Declares the specified procedure as deprecated
A term of the form Atom/Integer
A string


This declaration marks a predicate as deprecated. This means that a compile-time warning will be raised when a call to this predicate is compiled or when the predicate is explicitly imported. The warning will include the Advice-string, which is supposed to tell the user how to replace the deprecated predicate with a better equivalent.

Deprecation warnings can be suppressed using the pragma

   :- pragma(deprecated_warnings(off)).

Modes and Determinism


This predicate is sensitive to its module context (tool predicate, see @/2).


(4) instantiation fault
PredSpec or a component of it is not instantiated.
(4) instantiation fault
Advice is not instantiated.
(5) type error
PredSpec is instantiated, but not to a term of the form Atom/Integer.
(5) type error
Advice is instantiated, but not to a string.


    :- deprecated(foo/1, "Please use bar/2 instead").

See Also

compile / 1, pragma / 1, get_flag / 3