chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] This may be a bug in chickens hash tables - or my ba


From: John Cowan
Subject: Re: [Chicken-users] This may be a bug in chickens hash tables - or my bad
Date: Fri, 18 Dec 2015 12:35:16 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

Ivan Shmakov scripsit:

>       Given that the basic idea of hashing is to produce a key out of
>       the object’s /value/, the change of the value – and mutation
>       does just that – changes the hash.  

Well, yes and no.  SRFI 69 and other Scheme hash table frameworks
support at least two kinds of hashing: hash by value and hash by
identity.  If you have a large tree structure made with pairs, and
you want to keep ancillary information about some but not all of
the pairs, an identity-based hash table will let you keep the information
associated with *a particular pair*.  Otherwise, if you had a tree like
(a (b c) (b c)), then any information associated with the first (b c)
would be overwritten if you associated information with the second (b c).
This is quite independent of whether you ever mutate the tree or not.

-- 
John Cowan          http://www.ccil.org/~cowan        address@hidden
As you read this, I don't want you to feel sorry for me, because,
I believe everyone will die someday.
               --From a Nigerian-type scam spam



reply via email to

[Prev in Thread] Current Thread [Next in Thread]