[gambit-list] Passing lambdas as callbacks to C functions
pdawes at users.sf.net
Fri Feb 2 17:10:45 EST 2007
Hi Marc, Hi Gambit List,
I ran into problems using lambda expressions as callbacks when wrapping
libcsv and I've boiled it down to this testcase. Can anybody tell me why
(c-define (call-lambda l) (scheme-object) void "call_lambda" ""
(c-lambda (scheme-object) void
(looper (lambda () (write "foo"))))
looper is a c function which takes a scheme lambda and repeated invokes
it using the 'call_lambda' bridging function.
When I gsc compile it and run '(main)' after a bunch of looping and
printing it crashes with:
ERROR IN looper -- Operator is not a PROCEDURE
Any ideas? (or am I being stupid?!)
More information about the Gambit-list