Add method clear-elements.
authorFlavio Cruz <flaviocruz@gmail.com>
Thu Aug 21 15:12:43 2008 +0000 (3 months ago)
changeset 1183c03c2aa84e5a
parent 118224dfb1ed63c0
child 118467c801ab2c1a
Add method clear-elements.
--- a/tree-translator/sorted-container.lisp Tue Aug 19 17:30:33 2008 +0000
+++ b/tree-translator/sorted-container.lisp Thu Aug 21 15:12:43 2008 +0000
@@ -80,6 +80,12 @@
"Gets an element using 'key'."
(gethash key (table container)))
+(defmethod clear-elements ((container sorted-container))
+ "Clear all elements from the container."
+ (clrhash (table container))
+ (setf (sorted-list container) nil)
+ t)
+
;(defvar *a* (make-sorted-container #'string< #'first))
;(insert-element *a* (list "a" 2))
;(insert-element *a* (list "c" 5))