[gambit-list] table-update! primitive

Lassi Kortela lassi at lassi.io
Sat Oct 26 05:51:56 EDT 2019


> Can we add a table-update! primitive?
> Updates are currently slow because they need two lookups in the hash table,
> one to find the current value (if any) and one to set it.
> The canonical signature is (table-update! table key update default), where
> update is applied to the current value, using default if the value is unset.

+1

Existing versions of an update procedure:

;; R6RS

(hashtable-update!           table key update default)

;; SRFI 69

(hash-table-update!          table key update [thunk])
(hash-table-update!/default  table key update default)

;; SRFI 125

(hash-table-update!          table key update [failure [success]])
(hash-table-update!/default  table key update default)




More information about the Gambit-list mailing list