chickadee » slib-wt-tree » wt-tree/add

wt-tree/add tree key valueprocedure

Returns a new tree containing all the associations of tree as well as the association (key, value). Any existing association for key is replaced. (O(log n))

Example:

(let ((t (wt-tree/add (alist->wt-tree number-wt-type
                                      '((1 . 2) (2 . 4)))
                      5
                      10)))
  (wt-tree/lookup t 5 #f))  ; -> 10