[plt-scheme] namespaces and C extensions

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Apr 11 09:45:44 EDT 2004

At Sat, 10 Apr 2004 17:59:37 -0400, Daniel Silva wrote:
> How should I access Scheme code from C?

While it's technically possible for C code to access module-based
Scheme definitions, I recommend having the C code export a function to
register Scheme values.

 (module c-bindings mzscheme
   (define (spy-add-cpython-type id tobj)
      ...)

   (require "cpy-bindings.ss") ; really loads "cpy-bindings.so", which
                               ; provides `cpy-register'
   (cpy-register spy-add-cpython-type ....)

  ...)


Matthew



Posted on the users mailing list.