The order of the returned list is undefined.
The complexity of this operation is linear in the size of all keys and values, since they need to be copied.
Note: If StoreHandle is not a handle, then it must be an atom or a compound term, and the store is identified by this term's toplevel functor together with the context module.
?- store_create(Handle),
store_set(Handle, tom, 12345),
store_set(Handle, name(dick,tracy), phone(42376,home)),
store_set(Handle, numbers:prime, [2,3,5,7|_More]),
stored_keys_and_values(Handle, Data).
Handle = 'STORE'(16'003130e8)
Data = [(numbers : prime) - [2, 3, 5, 7|_More],
tom - 12345,
name(dick, tracy) - phone(42376, home)]
Yes (0.00s cpu)
?- store_create(Handle),
stored_keys_and_values(Handle, Data).
Handle = 'STORE'(16'003130e8)
Data = []
Yes (0.00s cpu)