From 280a06663c35a8b282f5d1cc8c33bf6648b3c9df Mon Sep 17 00:00:00 2001 From: erana Date: Sat, 21 Jan 2012 16:47:38 +0900 Subject: [PATCH] xanadu - btree --- scsh/xanadu/b-tree.scm | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/scsh/xanadu/b-tree.scm b/scsh/xanadu/b-tree.scm index 687d3fb..188321c 100644 --- a/scsh/xanadu/b-tree.scm +++ b/scsh/xanadu/b-tree.scm @@ -31,10 +31,7 @@ ;; copy vector nodes into n-ary vectors (from median splitted vecs) (define (make-b-tree-node l r) - (let ((numitems 0) - (numnodes 0) - (root 'foo) - (data #f) + (let ((data #f) (left l) (right r)) @@ -60,24 +57,9 @@ (define (get-right) right) - (define (get-root) - root) - - (define (get-numitems) - numitems) - - (define (get-numnodes) - numnodes) - (define (dispatch msg) (lambda (msg) - (cond ((eq? msg 'get-root) - get-root) - ((eq? msg 'get-numitems) - get-numitems) - ((eq? msg 'get-numnodes) - get-numnodes) - ((eq? msg 'get-left) + (cond ((eq? msg 'get-left) get-left) ((eq? msg 'set-left-with-index!) set-left-with-index!)