Prepare the new ldict implementation.
This commit is contained in:
parent
1d9edaa320
commit
fd927e3569
5 changed files with 38 additions and 9 deletions
|
@ -5,12 +5,13 @@
|
|||
|
||||
(module*
|
||||
util-bst-ldict
|
||||
#:doc ("xxx")
|
||||
#:doc ("Reimplementation of old list-based symbol dictionary using new BST backend.")
|
||||
(
|
||||
)
|
||||
|
||||
(import scheme
|
||||
util-bst)
|
||||
util-bst
|
||||
util-proc)
|
||||
|
||||
(define (symbol<? a b)
|
||||
(string<? (symbol->string a)
|
||||
|
@ -31,7 +32,7 @@
|
|||
(define (ldict-map proc ld)
|
||||
(let ((i 0)
|
||||
(both? ((procedure-arity>=? 2) proc))
|
||||
(index? ((procedure-arity=>? 3) proc)))
|
||||
(index? ((procedure-arity>=? 3) proc)))
|
||||
(bst-map-bst ld
|
||||
(lambda (k v)
|
||||
(let ((r (if both?
|
||||
|
@ -48,4 +49,6 @@
|
|||
(define (ldict-reduce init proc ld)
|
||||
(bst-reduce ld proc init))
|
||||
|
||||
(define ldict-equal? bst-equal?)
|
||||
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue