Added hash-table-values.

Pascal J. Bourguignon [2012-04-09 09:12]
Added hash-table-values.
Filename
common-lisp/cesarum/utility.lisp
diff --git a/common-lisp/cesarum/utility.lisp b/common-lisp/cesarum/utility.lisp
index 5763c52..20b7a7b 100644
--- a/common-lisp/cesarum/utility.lisp
+++ b/common-lisp/cesarum/utility.lisp
@@ -82,7 +82,8 @@
    ;; 17 - SEQUENCES
    "NSUBSEQ"
    ;; 18 - HASH-TABLES
-   "HASH-TABLE-KEYS" "HASH-TABLE-ENTRIES" "HASH-TABLE-PATH"
+   "HASH-TABLE-KEYS" "HASH-TABLE-VALUES"
+   "HASH-TABLE-ENTRIES" "HASH-TABLE-PATH"
    "COPY-HASH-TABLE"
    "HASHTABLE" "PRINT-HASHTABLE"
    ;;
@@ -1088,6 +1089,12 @@ RETURN:  When the SEQUENCE is a vector, the SEQUENCE itself, or a dispaced
     (maphash (lambda (k v) (declare (ignore v)) (push k result)) hash)
     result))

+(defun hash-table-values (table)
+  "Returns a list of the values in the hash-table."
+  (let ((result '()))
+    (maphash (lambda (k v) (declare (ignore k)) (push v result)) table)
+    result))
+
 (defun hash-table-entries (hash)
   "Returns an a-list of the entries (key . val) in the hash-table."
   (let ((result '()))
ViewGit