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        co...@ccil.org
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

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to