Thanks,
A usefull advice.
I already did something like that, using a guard-like construction that 
normalizes the key.
I use it for procedures (structs with procedure-property) that have to be eq? 
when representing the same mathematical function.
This way I can spare much memory and many cpu cycles.
However, I don't want all my objects being wrapped in structs.
Not all my data are lists. Some of them are seteq-s that are used as sequences.
I suppose using gen:equal+hash can do the same for me.
Nonentheless, by now I have all the info I need (and that, by now, I am 
familiar with)
Thanks again,
Jos

  _____  

From: Jon Zeppieri [mailto:zeppi...@gmail.com] 
Sent: jueves, 04 de agosto de 2016 19:06
To: Jos Koot
Cc: Racket Users
Subject: Re: [racket-users] equivalence relation for hash keys




On Thu, Aug 4, 2016 at 12:34 PM, Jos Koot <jos.k...@gmail.com> wrote:




Hi 

As far as I can see a hash has three options only for the equivalence relation 
comparing keys: eq?, eqv? and equal?. 
Would it be possible to extend Racket such as to allow the preparation of 
hashes with a user specified equivalence relation?

 snip 

Thanks, Jos



Or you could wrap your data (lists, I take it) in structs and define methods 
for gen:equal+hash on your struct type.

-J
 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to