[plt-scheme] modules and extensions

From: Pat Ekman (pat at ekman.cx)
Date: Wed Jun 8 18:40:02 EDT 2005

Phil Windley wrote:
> Scheme_Object *scheme_module_name() {
>   return scheme_false;
> }

You want to return scheme_intern_symbol("helloworld").

> (module helloworld mzscheme
> (load-extension "/Users/pjw/prog/scheme/mzgdbm/helloworld.dylib")
>   (provide
>      helloworld
>      )
>   )

That probably won't work.

Save the module to 
collects/helloworld/compiled/native/ppc-macosx/helloworld.dylib and 
import it with

   (require (lib "helloworld.ss" "helloworld"))

The .ss file doesn't have to exist.  If it does, it will be ignored 
unless no compiled modules exist.  That ppc-macosx directory is right 
for OS X.  Other systems will be different and can be determined inside 
of Scheme using (system-library-subpath).

You may also want to investigate the make collection (search the help 
desk) when you get tired of typing mzc commands.


Posted on the users mailing list.