[plt-scheme] User data structures and equality

From: Paulo J. Matos (pocm at soton.ac.uk)
Date: Tue Apr 10 16:23:47 EDT 2007

Hello all,

I want to define a bijective function f: D -> N, where D is a finite
collection of user data structures which have a known equality
procedure that given two elements of D know if they are equal or not.
Implementing this with alists is trivial, however, computing f and
f^-1 is done in linear time. The 'good' way would be hash-tables but I
can't since I have no hash-function for the data structures, only the
equality procedure [there is no obvious ordering between the user
structures since I don't really know what they are].

Any suggestions?

Paulo Jorge Matos - pocm at soton.ac.uk
PhD Student @ ECS
University of Southampton, UK

Posted on the users mailing list.