[ Predicate Database and Compiler | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]

# deprecated(++PredSpec, +Advice)

Declares the specified procedure as deprecated

PredSpec
  A term of the form Atom/Integer
Advice
  A string

## Description

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

- deprecated(++, +) is det

### Modules

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

### Exceptions

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

## Examples

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

## See Also

compile / 1, pragma / 1, get_flag / 3