Robert Roessler wrote:
...
While I am of course attempting to use some of the existing FFI code as
examples of how to do this (the "trees"), I don't fully grasp the
underlying idea(s) (the "forest")... and so am adding various
definitions of "set_finalize" into a number of extra/CInterface/*.ML
files - with "mixed results". :|

Could you outline the *minimum* changes to SML structures and signatures
to connect a

CInterface set_finalize vol -> sym -> unit

function to (I think)

static Handle set_finalize (TaskData *taskData, Handle h)

in foreign.cpp (assuming it will go in at the end of the "handlers" array)?

If it's helpful, I can be more specific about what I have tried... while I still really want to know how in general to add primitives to Poly (and *why* it is done that way), if it is easier for you to point out where I am going wrong, here is where our story so far:

CInterfaceSig (after val mapSym...)
        val set_finalize : vol -> sym -> unit

LowerLevelSig (after val mapSym...)
        val set_finalize : vol -> sym -> unit

LowerLevel (after fun get_sym...
        fun set_finalize vol sym =
            Volatile.set_finalize vol sym; (* Use Volatile. or not? *)

DispatchSig (after val toPascalfunction...)
        val set_finalize : rawvol -> rawvol -> unit

Dispatch (after val toPascalfunction...)
        val set_finalize = next(two);

VolatileSig (after val toPascalfunction...)
        val set_finalize : vol -> vol -> unit

VOLS_THAT_HOLD_REFS (after fun toPascalfunction...)

... and here is where I am stuck (semi-independently of how close any of the previous is or isn't). I am not at all sure of what to do here, but I *think* this is where I [finally] get down to my function in foreign.cpp. ;)

Again, thanks for any light you can shed.

Robert
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to