Re: [racket] General-purpose "hash-consing"

2014-06-30 Thread Matthew Flatt
You may already know that `datum-intern-literal` is implemented similarly, but `datum-intern-literal` hashes only certain kinds of values. The `canonicalize` function below accepts arbitrary values, so the `equal-hash-code` and `equal?` operations by the hash table can call arbitrary code. Running

[racket] General-purpose "hash-consing"

2014-06-30 Thread Tony Garnock-Jones
Hi all, I'd love any comments on the following as a general technique for "hash-consing" - that is, making (equal?) imply (eq?). (Corollary: two canonicalized values will be (eq?) iff they are (equal?).) Is it worth considering this as something to push into the C runtime for speed? #lang rack