[plt-scheme] Can I create module on the fly?

From: Jens Axel Soegaard (jensaxel at soegaard.net)
Date: Thu Jul 17 16:37:45 EDT 2008

Gregory Woodhouse skrev:
> (Actually, I'd like the module to be something I can read from a file 
> port at runtime)
> My initial attempt was
> > (define md (quote
>               (module m scheme/base
>                 (define x 11))))
> > (define ns (module->namespace ....
> But here I'm stuck. By itself, md or 'md isn't a legitimate module 
> path, but I'd like to create a namespace for eval, so I can evaluate 
> expressions in the module environment.

Just thinking out loud. How about:

   1. Use write to save  md  to a file named "md.scm".
   2. Use dynamic-require.


Jens Axel Søgaard


Posted on the users mailing list.