[ Type Testing | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]

current_functor(?PredSpec)

Succeeds if PredSpec is a functor known to the system.
PredSpec
Functor in the form Name/Arity or variable.

Description

Used to test whether PredSpec is a functor known to the system or to return all functors defined.

Note that PredSpec is specified in the format Name/Arity and may be specified with Name as an atom or variable and/or Arity as an integer or variable.

Modes and Determinism

Fail Conditions

Fails if PredSpec is not a currently known functor

Exceptions

(5) type error
PredSpec is instantiated but not in the format Atom / Integer

Examples

Success:
   current_functor(findall/N).
   current_functor(N/4).
   current_functor((',')/2).

   [eclipse]: current_functor(X).

   X = '' / 0     More? (;)

   X = findall / 0     More? (;)

   X = findall / 3     More? (;)

   X = at_eof_handler / 0     More? (;)    % RETURN pressed
   yes.
   [eclipse]:

Fail:
   current_functor(myfunctor/100).

Error:
   current_functor(abc)           Error 5.
   current_functor(man(1)).       Error 5.



See Also

atom / 1, current_atom / 1, current_op / 3