The table is like this : <string, int>. There is function foo that lookups the table with a key. If there is a record matching the key, foo decrease the value by 1. If the value is 0, foo delete the record.
I see there is a update_fn(key, fn) where fn can be defined to update the value. But how can I delete the record using fn ?
The table is like this :
<string, int>
. There is functionfoo
that lookups the table with akey
. If there is a record matching thekey
,foo
decrease the value by1
. If the value is0
,foo
delete the record.I see there is a
update_fn(key, fn)
wherefn
can be defined to update the value. But how can I delete the record usingfn
?