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. A store disappears when the system backtracks over its creation, when the store handle gets garbage collected, or when it is explicitly destroyed.
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.
% Creating and using an 'anonymous store' main2 :- store_create(Handle), store_set(Handle, name(peter,panther), data(1234,mobile)), store_set(Handle, name(tom,tiger), data(4567,home)), stored_keys_and_values(Handle, Contents), writeln(Contents). % Creating and using a 'named store' :- 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).