Thanks, I'll look into that. Jos -----Original Message----- From: Ryan Culpepper [mailto:ry...@ccs.neu.edu] Sent: jueves, 04 de agosto de 2016 18:40 To: Jos Koot; 'Racket Users' Subject: Re: [racket-users] equivalence relation for hash keys
See `define-custom-hash-types` in `racket/dict`. Note that you'll need to use `dict-ref` instead of `hash-ref`, etc. Ryan On 08/04/2016 12:34 PM, Jos Koot 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 > > > -- > 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 > <mailto:racket-users+unsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout. -- 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.