From: David Vázquez Date: Tue, 25 Feb 2014 23:32:36 +0000 (+0100) Subject: Add hash-table-count function X-Git-Url: http://repo.macrolet.net/gitweb/?p=jscl.git;a=commitdiff_plain;h=679997df8ce1605ac8d6e8c2c587726ef9c35f49 Add hash-table-count function --- diff --git a/src/hash-table.lisp b/src/hash-table.lisp index 0641ca8..301addd 100644 --- a/src/hash-table.lisp +++ b/src/hash-table.lisp @@ -106,3 +106,12 @@ (hash (funcall (cadr hash-table) key))) (prog1 (in hash obj) (delete-property hash obj)))) + + +(defun hash-table-count (hash-table) + (let ((count 0)) + (map-for-in (lambda (x) + (declare (ignore x)) + (incf count)) + (caddr hash-table)) + count))