[plt-scheme] x != x for module names?!

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Jan 30 12:55:18 EST 2010

At Sat, 30 Jan 2010 16:51:53 +0000, Norman Gray wrote:
> ...and now I get a different error:
> 
> % mzscheme -e '(path->string (build-path "compiled" "native" 
> (system-library-subpath)))'
> "compiled/native/i386-macosx/3m"
> % ls -l compiled/native/i386-macosx/3m
> total 200
> -rwxr-xr-x  1 norman  admin  101560 30 Jan 16:03 Redland_ss.dylib*
> % mzscheme
> Welcome to MzScheme v4.2.4 [3m], Copyright (c) 2004-2010 PLT Scheme Inc.
> > (require "Redland.ss")
> require: unknown module: 
> "/Data/tools/000-Build/mzscheme-librdf-bindings/Redland.ss"

Are you using scheme_primitive_module() to declare the module?

The overview doesn't give an example of declaring a module, so here's
an example of implementing the module `x' that exports a `yes' binding:

 #include "escheme.h"

 Scheme_Object *scheme_initialize(Scheme_Env *env) {
   Scheme_Env *mod_env;

   mod_env = scheme_primitive_module(scheme_intern_symbol("x"),
                                     env);

   scheme_add_global("yes", scheme_true, mod_env);

   scheme_finish_primitive_module(mod_env);
	
   return scheme_void;
 }

 Scheme_Object *scheme_reload(Scheme_Env *env) {
   return scheme_initialize(env); /* Nothing special for reload */
 }

 Scheme_Object *scheme_module_name() {
   return scheme_intern_symbol("x");
 }

> Incidentally, the text in "1.2.2: 3m extensions" shows --xform and 
> --cc being given together, which is not allowed.

I'll fix that while adding a module example to the docs.



Posted on the users mailing list.