chickadee » slib-wt-tree » wt-tree/rank

wt-tree/rank tree keyprocedure

Returns the 0-based position of key in the sorted sequence of keys of tree. If key has no association in tree, then #f is returned instead.

(let ((t (alist->wt-tree string-wt-type
                         '(("rincewind" . 23)
                           ("twoflower" . 11)
                           ("the luggage" . 31)))))
  (wt-tree/rank "twoflower"))
; -> 1