[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Hash table equality pitfall
From: |
Alex Queiroz |
Subject: |
Re: [Chicken-users] Hash table equality pitfall |
Date: |
Fri, 2 Mar 2012 10:50:38 +0100 |
Hallo,
Sending back to list...
On Fri, Mar 2, 2012 at 10:43 AM, Pierpaolo Bernardi <address@hidden> wrote:
> On Fri, Mar 2, 2012 at 10:32, Alex Queiroz <address@hidden> wrote:
>> On Thu, Mar 1, 2012 at 7:01 PM, Peter Bex <address@hidden> wrote:
>>>
>>> If they do it "correctly", how do they deal with differences in initial
>>> bucket size, and what do they do with hash tables having identical
>>> key/values but different hashing or different comparison procedures?
>>>
>>
>> If I were to write a `equal?` procedure for hash-tables, my test for
>> "correctness" would be:
>>
>> (equal? hash-table1 hash-table2) iff (equal? (hash-table->alist
>> hash-table1) (hash-table->alist hash-table2))
>>
>> provided that `hash-table->alist` does the obvious thing.
>
> I'd expect a procedure named hash-table->alist to return an alist in
> no particular order.
>
> I guess you meant to insert a couple of sorts in there. ;^)
>
You are right, the "obvious" hash-table->alist is not so obvious then. :)
--
-alex
http://www.artisancoder.com/