[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emptying an hashtable
Received: from eldi.epfl.ch by SIC.Epfl.CH with VMSmail ; Thu, 31 May 90 08:51:56 N
I use a lot of hashtables having the form described below:
(make-hash-table :test #'equal
When I have to empty them, I use the following function:
(defun reset-hashtable (table)
(maphash #'(lambda (key value)
(declare (ignore value))
(remhash key table))
Both declarations correspond to the description in the chapter 16 of ClTl,
and everything works well.
But, I had another slightly different table:
(make-hash-table :test #'eq ; instead of EQUAL
>From the CLtl, EQ is also usable. But, When I tried to empty *another-table*,
only one element was removed. I had to recreate it with the test being EQUAL
so that my procedure worked.
Is this a bug (maybe known) or did I misunderstand something?
Emmanuel Baechler firstname.lastname@example.org
Swiss Federal Institute of Technology at Lausanne