[ Recorded Database | Reference Manual | Alphabetic Index ]

recorded_list(+Key, -List)

Succeeds if the List is the list of all terms that are currently recorded in the indexed database under the key Key.
Key
An atom or a compound term.
List
A (possibly empty) list of Prolog terms.

Description

Unifies List with a list of all the terms that are currently recorded under the key Key. While recorded/2 returns the terms one by one on backtracking, recorded_list/2 gives them all at once. The order of the list corresponds to the order in which the terms would be delivered by recorded/2. recorded_list/2 could be defined as

    recorded_list(Key, List) :-
        findall(Term, recorded(Key, Term), List).
In the case of compound terms, all keys of the same name and arity are treated as equal.

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 an atom nor a compound term.
(5) type error
List is neither an variable nor a list.

Examples

   Success:
   [eclipse]: erase_all(beer), recorded_list(beer,List).
   List = []
   yes.
   [eclipse]: record(beer,paulaner), record(beer,lowenbrau),
   recorda(beer,spaten), recorded_list(beer,List).
   List = [spaten, paulaner, lowenbrau]
   yes.
   Fail:
   erase_all(beer), recorded_list(beer,[paulaner]).
   Error:
   recorded_list(Beer,Value).                (Error 4)
   recorded_list(1,Value).                   (Error 5)
   recorded_list(beer,lowenbrau).            (Error 5)



See Also

record / 2, recorded / 2