[racket] Struct equality for foreign pointers

From: Eric Dobson (endobson at cs.brown.edu)
Date: Mon Nov 22 09:29:22 EST 2010

I am interfacing with a foreign library and have a datatype whose
representation in racket is a cpointer, where equality is ptr-equal?.
I want to make a struct encapsulating this using prop:equal+hash to
make struct equality match the foreign library's equality operator. Is
there a way to get something that I could use to make the hash
function? I wanted to get the actual pointer value, but did not see a
way of extracting that from the cpointer, only the offset.

-Eric


Posted on the users mailing list.