[ Recorded Database | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]
recorda(+Key, ?Value, -DBRef)
Records the term Value at the beginning of key Key in the indexed database.
- +Key
- An atom or compound term.
- ?Value
- Any prolog term.
- -DBRef
- A variable.
Description
Used to record any prolog term Value at the beginning of the indexed
database entry associated with the key Key. Unlike recorda/2, this
predicate delivers a so-called database reference in DBRef which is a
unique name for the indexed database entry that is created. Note that
it is not a number! In the case of compound terms, all keys of the same
name and arity are treated as equal.
If backtracking occurs through the call of recorda/3 the associated
Value is not removed from the indexed database.
Fail Conditions
None.
Resatisfiable
No.
Exceptions
- (4) instantiation fault
- Key is not instantiated.
- (5) type error
- Key is neither an atom nor a compound term.
- (5) type error
- DBRef neither a variable nor a database reference.
Examples
Success:
[eclipse]: recorda(whiskey,jameson,Ref1),
recorda(whiskey,bushmills,Ref2).
Ref1 = 98518
Ref2 = 98538
yes.
Error:
recorda(Key, anything, Ref). (Error 4)
recorda("key",anything, Ref). (Error 5)
recorda(key,anything, 99). (Error 5)
See Also
recordz / 3, recorded / 3, erase / 1, referenced_record / 2