Prepare the new ldict implementation.

This commit is contained in:
Dominik Pantůček 2023-07-07 12:07:19 +02:00
parent 1d9edaa320
commit fd927e3569
5 changed files with 38 additions and 9 deletions

View file

@ -429,9 +429,21 @@ arguments.")
("Returns true if both BSTs contain the same keys and values.")
(if (bst-compat? b1 b2)
(let-comparators
(EQ? <? b1)
#t
)
(EQ? _ b1)
(let ((g1 (bst-kv-iterator b1))
(g2 (bst-kv-iterator b2)))
(let loop ()
(let ((kv1 (g1))
(kv2 (g2)))
(if (and (not kv1)
(not kv2))
#t
(if (and (EQ? (car kv1)
(car kv2))
(equality? (cdr kv1)
(cdr kv2)))
(loop)
#f))))))
#f))
;; Module self-tests