This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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:
()
()


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]