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

From: Jos Koot (jos.koot at telefonica.net)
Date: Thu Jul 17 16:23:29 EDT 2008

You mean

(require scheme/base)
(define mm '(module mm mzscheme (provide z) (define z 3)))
(define ns (make-base-namespace))
(eval mm ns)
(eval '(require 'mm) ns)
(eval 'z ns) ;--> 3

  ----- Original Message ----- 
  From: Gregory Woodhouse 
  To: plt-scheme at list.cs.brown.edu 
  Sent: Thursday, July 17, 2008 10:09 PM
  Subject: [plt-scheme] Can I create module on the fly?

  (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.

  "The art of asking the right questions in mathematics is more important than the art of solving them."
  --Georg Cantor



    For list-related administrative tasks:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080717/563f47a5/attachment.html>

Posted on the users mailing list.