MoronicAcid MoronicAcid - 1 year ago 90
C Question

How does one create a C function pointer from a Scheme function in Guile?

I am trying to write a wrapper for a C library that contains a function which takes another function to achieve polymorphism (i.e. a generic function). I would like to write my wrapper such that it takes a Scheme function and passes it to the generic function as a C function pointer. Does Guile provide functionality that would allow me to turn a Scheme function into a C function pointer?

Answer Source

You have to use procedure->pointer procedure which is described in the manual.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download