Jonathan Mayer
Jonathan Mayer

Reputation: 79

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?

Upvotes: 2

Views: 106

Answers (1)

amirouche
amirouche

Reputation: 7883

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

Upvotes: 2

Related Questions