hashtable_set(ht, key, v)
Assign the value v
to the element identified by key
in the hash table ht
. Raise an "argument" error
if ht
is not a hash table. If key
in not found in the hash table, a new entry for it is created.
Return void
.
let xs = #{'a:1, 'b:2}
hashtable_set(xs, 'b, 20)
xs
// #{b: 20, a: 1}
hashtable_set(xs, 'c, 30)
xs
// #{c: 30, b: 20, a: 1}
xs['a] = xs['a] + 10
xs
// #{c: 30, b: 20, a: 11}