sorted-map-values

This commit is contained in:
Tony Garnock-Jones 2014-07-18 11:34:43 -07:00
parent a5dc977d73
commit f6a8b84d81
1 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,7 @@
sorted-map-max
sorted-map-delete
sorted-map-keys
sorted-map-values
)
(require "canonicalize.rkt")
@ -456,3 +457,10 @@
(match node
[(T! l k v r) (walk l (set-add (walk r acc) k))]
[(L _) acc])))
;; tonyg 20140718 Retrieve a list of the values of smap
(define (sorted-map-values smap)
(let walk ((node smap) (acc '()))
(match node
[(T! l k v r) (walk l (cons v (walk r acc)))]
[(L _) acc])))