Commits

Robert Smith committed eea6423

* change PRODUCT argnames to be more general
* add HASH-TABLE-KEYS

  • Participants
  • Parent commits 2ba2892

Comments (0)

Files changed (1)

File utilities.lisp

   (loop :for x :in list
         :maximizing (funcall key x)))
 
-(defun product (list &key (key 'identity))
-  "Compute the product of the items in LIST, optionally via the
+(defun product (seq &key (key 'identity))
+  "Compute the product of the items in SEQ, optionally via the
 function KEY."
-  (reduce '* list :key key :initial-value 1))
+  (reduce '* seq :key key :initial-value 1))
 
 (defun sign (x)
   "Return the sign of X."
     (declare (ignore val))
     existsp))
 
+(defun hash-table-keys (hash-table)
+  "Return a list of the hash table keys of HASH-TABLE."
+  (loop :for k :being :the :hash-keys :of hash-table
+        :collect k))
+
 (defun hash-table-values (hash-table)
   "Return a list of the hash table values of HASH-TABLE."
   (loop :for v :being :the :hash-values :of hash-table