From 679997df8ce1605ac8d6e8c2c587726ef9c35f49 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Wed, 26 Feb 2014 00:32:36 +0100 Subject: [PATCH] Add hash-table-count function --- src/hash-table.lisp | 9 +++++++++ 1 file changed, 9 insertions(+) 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)) -- 1.7.10.4