[prev in list] [next in list] [prev in thread] [next in thread] 

List:       racket-users
Subject:    [plt-scheme] Copying bindings between namespaces
From:       tlilja () niksula ! cs ! hut ! fi (Timo Lilja)
Date:       2002-08-28 12:24:31
Message-ID: 87lm6rkw74.fsf () frog ! cs ! hut ! fi
[Download RAW message or body]

Shriram Krishnamurthi <sk at cs.brown.edu> writes:

>Are you aware of the new module system in PLT 200 (whose head keyword
>is `module')?  If for some reason you've rejected a solution based on
>that, it would help to know why.
>

I looked into this module system and couldn't really figure out how to
use it. I tried something like this:

First let's create a module which contains the forms I want:

(module my-primitives mzscheme
  (provide +)
  (provide #%module-begin)
  (provide #%app)
  (provide #%datum)
  (provide #%top)
  (provide define)
  (provide provide))

And this has to be required:

(require my-primitives)

Now I can create another module which uses 'my-primitives' and thus
contains only the needed forms and primitives:

(module my-eval-module my-primitives
  (define result <untrusted code here>)
  (provide result))

After this, I require 'my-eval-module' and get the evalution result
from the variable 'result'. So it seems that this would need a macro
wrapped to the code above but I I can't do this because module
declarations can appear only at the top level.


-- 
Timo Lilja




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic