[gambit-list] cast scheme procedure to c function
alvaro.castro.castilla at gmail.com
Tue Nov 22 19:52:51 EST 2011
I'm trying to make a procedure that takes one argument (another procedure)
and converts it to a C function, assigning it to a function pointer in C.
Then I want to call that function from that pointer in C.
I'm aware that the typical way to do this is with c-declare in a static
way, but I need to be able to achieve the same without using c-declare.
My current attempt:
(define (uno) 1)
(define bind (c-lambda (scheme-object) void "simple_callable = ___CAST(void
...then the C part, same file:
// after (bind uno) is executed
I guess that I'm doing either the input type or the cast (or both) wrong.
Probably I'm assuming to much simply casting a "scheme-object" to a
void(*)(). Is this what I'm trying to do even possible?
Thanks a lot!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gambit-list