[plt-scheme] modules

From: Corey Sweeney (corey.sweeney at gmail.com)
Date: Mon Mar 28 11:00:40 EST 2005

I have a interesting situation in trying to make a module.  What i've
got is a file statement-bnf.scm which is directly included in my
documentation by the word processor I use.  Inside this file, it
defines PC-BNF (and the definition of PC-BNF is what dynamically gets
loaded into the documentation).  Now I don't want "(module xxx ...
provide ...." showing up in the documentation. So I can make a wrapper
of:

statement-bnf-wrapper.ss:
(module statement-bnf-wrapper (lib "plt-pretty-big-text.ss" "lang")
  (provide PC-BNF)  
  (load "statement.bnf.scm"))


but this catches on PC-BNF saying it's not defined.  We can easily get
around this by changing it to:

statement-bnf-wrapper.ss:
(module statement-bnf-wrapper (lib "plt-pretty-big-text.ss" "lang")
  (provide *)  
  (load "statement.bnf.scm"))


and this works fine. for statement-demo.scm:
  (require "statement-bnf-wrapper.ss")
  (display PC-BNF)  


 However I noticed that it does not work in a requiring module like:

statement-demo.ss:
(module statement-demo (lib "plt-pretty-big-text.ss" "lang")
  (require "statement-bnf-wrapper.ss")
  (display PC-BNF)  
  (provide PC-BNF)  
  (load "statement.bnf.scm"))

this generates a error when it encounters PC-BNF, which might be
unexpected for the person calling statement-demo.  I've found
references to "unsafe" provides from foriegn.ss in the manual, but not
a lot of documentation on them, could they help in explicitly passing
the info of PC-BNF's "inherited" existance to a calling module?

Corey



Posted on the users mailing list.