[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to avoid warnings looping over a hash table
- To: info-mcl@cambridge.apple.com
- Subject: How to avoid warnings looping over a hash table
- From: "Mark A. Tapia" <markt@dgp.toronto.edu>
- Date: Tue, 7 Jul 1992 13:12:47 -0400
- Cc: bug-mcl@cambridge.apple.com
Using MCL2.0f3, when I use the extended loop construct
to iterate over a hash table, the compiler sometimes
generates a message indicating that a variable has not
been used.
I'd like to clean up the warning messages but don't
know how.
Thanks
(defvar a-hash-table (make-hash-table :test #'equal))
(setf (gethash '(1 2 3) a-hash-table) t)
(defun dump-hash (table)
(when (hash-table-p table)
(loop for key being the hash-key in table using (hash-value val)
do (print-db key val))))
(dump-hash a-hash-table)
---> output
;Compiler warnings :
; Unused lexical variable #:G15431, in DUMP-HASH.
KEY (1 2 3)
VAL T
NIL