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?
>
> May be I can prepare it myself, but I have no idea where to start.
> Pointers welcome, of course.
>
> For example, I am interested in a hash with the following equivalence
> relation for its keys:
>
> (lambda (x y) (equal? (sort x <) (sort y <)))
> x : exact-nonnegative-integer?
> y : exact-nonnegative-integer?
>
> 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