For each entry in the hash table
ht, call the function
fn by passing it the key
and value as arguments. The order in which keys and values are visited is unspecified.
While a call to
hashtable_for_each is being performed on
ht, it is an error to call any of the following
hashtable_entries. It is also an error to compare for equality (directly or indirectly with
etc.) an object that contains
ht. All these functions may cause the hash table to be reordered and resized.
This restriction allows a more efficient iteration over the key/value bindings.
let h = make_eq_hashtable() hashtable_set(h, 'name, "nemo") hashtable_set(h, 'age, 1) hashtable_for_each(^(k, v) println(k, ": ", v), h) //> name: nemo age: 1
Core Module Index | Contents