[plt-scheme] ffi callback

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Apr 24 22:14:32 EDT 2005

On Apr 24, Jean-François Trevien wrote:
> ~   I' ve begin to make some test with the 'foreign' library. But when
> i arrive to the section ffi callback i read that:
> 
> 'These functions are provided by the internal #%foreign, but not
> re-provided from foreign. They are listed with brief explanations. If
> you find any of these useful, please let us know.'
> 
> ~ I made my test with the sqlite lib and without callback it will be
> useless. There is a lot of C libraries that use heavily callback.
> ~ Is there a way to activate them (modifying the source foreign.ss
> perhaps)  ?

The `callback' objects are used in the Scheme part of the
implementation, and I didn't see any other place where they are
useful.  People who write interfaces should not use these objects
directly -- they get it using a `_fun' type: if you have a function
argument that has a `_fun' type, or simply set the value of a C
pointer using a `_fun' type, the Scheme procedure that you should
provide will get converted to a callback.
-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!



Posted on the users mailing list.