This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Hash tables
- From: "Daniel Terhorst" <daniel dot s dot terhorst at gmail dot com>
- To: kawa at sourceware dot org
- Date: Wed, 16 Jan 2008 10:01:26 -0800
- Subject: Hash tables
I ran into some unexpected behavior with hash tables today, rather by
coincidence, it seems. If I create a hash-table with two keys, "53gqi"
and "6vxk4", I become unable to delete the first from the table. If I
change the keys in any way or try to remove the second one first, it
works as expected, so this seems to be due to some kind of collision.
I wouldn't expect that to cause delete to no-op, however, so I suspect
it's just a bug that hasn't been detected until now.
;; -*- scheme -*-
(require 'srfi-69)
(let ((H (alist->hash-table '(("53gqi")
("6vxk4"))))
(key "53gqi"))
(values (html:p (hash-table-ref H key))
(hash-table-delete! H key)
(html:p (hash-table-ref/default H key "GONE =)"))))
#\newline
---
Expected:
()
GONE =)
Actual:
()
()