Next: , Previous: , Up: bbtrees   [Contents][Index]


10.2 Constructors and predicates

Function: make-bbtree ITEM<

Build and return a new, empty bbtree. Bbtrees derived from the returned one will use the procedure argument ITEM< for ordering keys.

Function: bbtree? any

Return #t if the argument is a bbtree, #f otherwise.

Function: bbtree->alist BBTREE

Return the key/value associations from BBTREE as a list of pairs. The list returned is in sorted order according to the ordering procedure of BBTREE. A consequence of this is that one could write a sort procedure for lists of pairs as:

(define (alist-sort alist <)
  (bbtree->alist (alist->bbtree alist <)))
Function: alist->bbtree alist ITEM<

Return the bbtree containing each of the key/value pairs in alist, using the ITEM< argument as the ordering procedure.

(alist->bbtree '(("foo" . 10) ("bar" . 12))
               string<?)
⇒ #[bbtree]

Next: , Previous: , Up: bbtrees   [Contents][Index]

This document describes version 0.5.0-devel.1 of MMCK PFDS.