Author: abaine Date: Fri Aug 10 18:26:43 2007 New Revision: 131
Modified: trunk/funds/src/f-array.lisp Log: Implemented f-array-elt, f-array-replace, and f-array-size.
Modified: trunk/funds/src/f-array.lisp ============================================================================== --- trunk/funds/src/f-array.lisp (original) +++ trunk/funds/src/f-array.lisp Fri Aug 10 18:26:43 2007 @@ -16,7 +16,14 @@ (f 0 size))))
(defun f-array-elt (array index) - ) + (tree-find array index :test #'=))
(defun f-array-replace (array index item) - ) + (tree-insert array index item :test #'=)) + +(defun f-array-size (array) + (labels ((f (tree amount) + (if (tree-empty-p tree) + amount + (f (bt-right tree) (bt-key tree))))) + (f array 0)))