[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] hash table question
From: |
Peter Keller |
Subject: |
[Chicken-users] hash table question |
Date: |
Fri, 2 Aug 2002 20:22:20 -0500 |
User-agent: |
Mutt/1.2i |
Hello,
I have a question about the hash tables that chicken implements.
Suppose I do this:
>>> Linux black > csi
; This is the CHICKEN interpreter - Version 0, Build 1072 - linux-unix-gnu-x86
; (c)2000-2002 Felix L. Winkelmann
>>> (define foo (make-hash-table))
>>> (hash-table-set! foo "foobar" 0)
>>> (hash-table-ref foo "foobar")
#f
This seems like a natural thing for me to do, but since the hash tables use
eq? to do the compare, it will fail since (eq? "foobar" "foobar") is defined
to fail.
My question is, why is it like this? Is there any way to control the equality
function or the hashing algorithm?
Suppose I want to replace eq? with equal?.
Thanks.
-pete
- [Chicken-users] hash table question,
Peter Keller <=