[elephant-devel] map ?

Nicolas Lamirault lam at tuxfamily.org
Mon Sep 6 16:17:03 UTC 2004


hi,
i read  the elephant's  tutorial, and i  would like  to know if  it is
possible to have a map function with btree ?
an example :

CL-USER> (use-package "ELE") 
T
CL-USER>  (defvar friends-birthdays (make-instance 'btree)) 
FRIENDS-BIRTHDAYS 
CL-USER> (add-to-root "friends-birthdays" friends-birthdays) 
#<BTREE {A0F7259}> 
CL-USER> (setf (get-value "Andrew" friends-birthdays) "12/22/1976") 
"12/22/1976" 
CL-USER> (get-value "Andrew" friends-birthdays) 
"12/22/1976" 
T 
CL-USER> (setf (get-value "lam" friends-birthdays) "01/01/1976") 
"01/01/1976" 
CL-USER> (get-value "lam" friends-birthdays) 
"01/01/1976" 
T 

and a mapbtree function :

(mapbtree #'(lambda (key value) 
                     (format t "~A : ~A~%" key value))
                 friends-birthdays) 

-- 
Nicolas Lamirault




More information about the elephant-devel mailing list