[funds-cvs] r131 - trunk/funds/src
abaine at common-lisp.net
abaine at common-lisp.net
Fri Aug 10 22:26:44 UTC 2007
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)))
More information about the Funds-cvs
mailing list