[ Type Testing | Reference Manual | Alphabetic Index ]
callable(?Term)
Succeeds if Term is callable, i.e. of type atom or compound.
- Term
- Prolog term.
Description
Used to test whether Term is a 'callable' term, i.e. whether it
is an atom or compound term, and could therefore be used as a goal.
Note that this is a purely syntactic check which does not say
anything about the existence of a corresponding predicate.
This predicate is equivalent to
    callable(X) :- atom(X).
    callable(X) :- compound(X).
Note that it also succeeds for lists.
Modes and Determinism
Fail Conditions
Fails if Term is not an atom or a compound term
Examples
Success:
   callable(true).
   callable(hello("world",42)).
   callable(f(1,2)).
   callable([1,2,3]).
   callable(.(1,2)).
   callable(foo).
   callable([]).
Fail:
   callable("f(1,2)").
   callable(_).
   callable(42).
   make_suspension(true,0,S), callable(S).
See Also
atom / 1, compound / 1, is_list / 1, is_array / 1, var / 1