[plt-scheme] eval and modules

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sat Aug 10 23:35:16 EDT 2002

> Compiling an 'eval'-intensive Scheme code to standalone executable

That's a problem. The way that the module system simplifies various
tasks (like compilation and creating standalone executables) is to
avoid the top level.

> So, the question is: how to compile (with "mzc --exe") a code
> where top-level bindings has to be visible in 'eval'?

I don't have a good answer. When I write code that uses `eval', the
code also uses functions like `make-namespace' and
`namespace-set-variable-value!' to explicitly install bindings into the
top-level environment.

> Auxiliary question: for 'mzscheme -r' it was necessary to add 
> 
> (require a)
> 
> in order to run the latter example above.
> Is it the proper way to interpret a module using command-line mzscheme? 

Use -u instead. Here's a longer explanation:

 http://download.plt-scheme.org/doc/201/html/mzscheme/mzscheme-Z-H-18.html


Matthew




Posted on the users mailing list.