Thu Jul 23 15:11:12 CEST 2009
Wrapping external pointers
There doesn't seem to be any interface for managing external data.
I'm adding a "void" datatype.
what this requires:
- T_DATA type tag (enough bits?)
- typedef foreign_data
- garbage collector: recursive mark() on scheme data
- scheme predicate (general: defs should define their own predicate)
The only problem is that there is only a single type of foreign data,
so the C side should make sure it can interpret a void pointer,
i.e. by adding an extra level of wrapping.
This is then solved by using the finalize operation as the type.
EDIT: I am officially stupid. The hacking.txt document explains
exactly what I just did. Nobody read the docs, doc!
Ok it seems to be mostly what I did, except that my extension
abstracts pointers and uses the destructor as a type tag.