[ Recorded Database | Reference Manual | Alphabetic Index ]
Succeeds if the term Value associated with key Key is removed as an entry
in the indexed database.
- Atom, compound term, or handle.
- Any Prolog term.
Finds the first term associated with Key that can be unified with Value
and removes its entry from the indexed database. It fails if such an
entry cannot be found. If Value is uninstantiated, the first value
under the key Key is removed. In the case of compound terms, all keys
of the same name and arity are treated as equal. Backtracking through
calls of erase/2 does not undo an erasure.
Modes and Determinism
- erase(+, +) is semidet
- erase(+, -) is semidet
This predicate is sensitive to its module context (tool predicate, see @/2).
Fails if Value does not unify with any term recorded under the key Key
- (4) instantiation fault
- Key is not instantiated.
- (5) type error
- Key is neither an atom nor a compound term.
Value = jameson
L = bushmills More? (;)
L = glenfiddich More? (;)
no (more) solution.
erase(Key,anything). (Error 4)
erase("whiskey",anything). (Error 5)
erase_all / 1