A store is a persistent (w.r.t. backtracking) hash table. It can store arbitrary ECLiPSe terms under arbitrary ground keys.
Stores can be referred to either by handle or by name. Whenever possible, handles should be used, because this naturally leads to robust, reentrant code, and avoids the danger of memory leaks. See store_create/1 for how to create stores with a handle.
Named stores are identified by a functor. This is usually simply an atom, but in general it can be name/arity pair.
When named stores are used, the visibility of the store name is local to the module where it was created. A named store never disappears, therefore, in order to free the associated memory, its contents should be erased when no longer needed.
Duplicate store declarations are silently ignored.
% A store with the simple, atomic name 'phone_numbers' :- local store(phone_numbers). main1 :- store_set(phone_numbers, name(peter,panther), data(1234,mobile)), store_set(phone_numbers, name(tom,tiger), data(4567,home)), stored_keys_and_values(phone_numbers, Contents), writeln(Contents). % A store identified by the functor foo/3 :- local store(foo/3). main2 :- store_set(foo(_,_,_), key_1, value_1), store_set(foo(_,_,_), key_2, value_2), stored_keys_and_values(foo(_,_,_), Contents), writeln(Contents).