[ Recorded Database | Reference Manual | Alphabetic Index ]

recorda(+Key, ?Value)

Records the term Value before all other entries for key Key in the record database.
Key
An atom, compound term, or handle.
Value
An arbitrary term.

Description

Used to record an arbitrary term Value at the beginning of the record database entry associated with the key Key. 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/2 the associated Value is not removed from the record database.

Modes and Determinism

Modules

This predicate is sensitive to its module context (tool predicate, see @/2).

Exceptions

(4) instantiation fault
Key is not instantiated.
(5) type error
Key is neither atom, compound term, nor record handle.

Examples

   Success:
    recorda(a(compound,term),value1).
    recorda([a,compound,term],value2).

    [eclipse]: recorda(whiskey,jameson),
    >        recorda(whiskey,bushmills),
    >        recorda(whiskey,glenlivet).
    yes.
    [eclipse]: recorded(whiskey,Value).
    Value = glenlivet     More (;)
    Value = bushmills     More (;)
    Value = jameson     More (;)
    no (more) solution.
Error:
    recorda(Key, anything).             (Error 4)
    recorda("key",anything).            (Error 5)



See Also

record / 2, recordz / 2