[ Predicate Database and Compiler | Reference Manual | Alphabetic Index ]
current_built_in(?PredSpec)
Succeeds if the predicate defined by PredSpec is a visible built-in
predicate.
- PredSpec
- Expression of the form Atom/Integer or variable.
Description
Used to check that PredSpec is a built-in predicate visible from the
context module, or else to return on backtracking all the visible
built-in predicates.
Modes and Determinism
- current_built_in(++) is semidet
- current_built_in(-) is nondet
Modules
This predicate is sensitive to its module context (tool predicate, see @/2).
Fail Conditions
Fails if the predicate defined by PredSpec is not a visible built-in
predicate
Exceptions
- (5) type error
- PredSpec is instantiated, but not to the form Atom/Integer.
Examples
Success:
[eclipse]: current_built_in(X/Y),!.
X = findall
Y = 3
yes.
[eclipse]: current_built_in(X).
X = findall / 3 More? (;)
X = ! / 0 More? (;)
X = delayed_goals / 1 More? (;)
X = delayed_goals / 2 More? (;) % type <cr>
yes.
Fail:
current_built_in(assertz/1).
current_built_in(reverse/2).
[eclipse]: [user].
p.
user compiled 28 bytes in 0.00 seconds
yes.
[eclipse]: get_flag(p/0, type, T).
T = user
yes.
[eclipse]: current_built_in(p/0).
no.
Error:
current_built_in(a/a). (Error 5).
See Also
current_predicate / 1, current_module_predicate / 2, is_predicate / 1