[ Recorded Database | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]

recorded(+Key, ?Value)

Succeeds if the term Value has been recorded in the indexed database under the key Key.
+Key
An atom or a compound term.
?Value
Any Prolog term.

Description

Used to find all values associated with a key. Unifies Value with the first term that has been associated with Key. In the case of compound terms, all keys of the same name and arity are treated as equal.

Backtracking will unify Value with successive values associated with Key in the order in which they were recorded.

Fail Conditions

Fails if the value Value cannot be unified with an associated value of the key Key.

Resatisfiable

Yes.

Exceptions

(4) instantiation fault
Key is not instantiated.
(5) type error
Key is neither an atom nor a compound term.

Examples

   Success:
   [eclipse]: record(beer,paulaner),
   >        record(beer,lowenbrau),
   >        record(beer,spaten),
   >        recorded(beer,Value).
   Value = paulaner     More? (;)
   Value = lowenbrau     More? (;)
   Value = spaten     More? (;)
   no (more) solution.
   Fail:
   erase_all(beer),recorded(beer,guiness).
   Error:
   recorded(Beer,Value).                (Error 4)
   recorded("beer",Value).              (Error 5)
   recorded(1,Value).                   (Error 5)



See Also

record / 2