Start implementing symbol ldict.
This commit is contained in:
parent
0bcc49f99e
commit
33fadab5e7
3 changed files with 66 additions and 0 deletions
|
|
@ -35,6 +35,8 @@
|
|||
|
||||
bst-update
|
||||
|
||||
bst-filter
|
||||
|
||||
util-bst-tests!
|
||||
)
|
||||
|
||||
|
|
@ -375,6 +377,14 @@
|
|||
new-root
|
||||
(+ (bst-count bst) add-count)))))
|
||||
|
||||
(define/doc (bst-filter bst pred?)
|
||||
("Returns a BST with only KV pairs matching the predicate which must
|
||||
accept two arguments.")
|
||||
(kvv->bst
|
||||
(cons TAG-KVV
|
||||
(cons (apply vector (bst-filter-pairs bst pred?))
|
||||
(cddr bst)))))
|
||||
|
||||
;; Module self-tests
|
||||
(define (util-bst-tests!)
|
||||
(run-tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue