Hi,

I've been trying to create a namespace and then import it at a different phase, 
but I can't get it to work. Basically, it seems like an issue with the base 
phase of a namespace being set by the module that is requiring it, rather than 
the module that it is in. Is there a way to get around this?

Here's an example of what I want to work:

;; tmp.rkt
#lang racket

(provide ns)

(define x 1)
(define-namespace-anchor a)
(define ns (namespace-anchor->namespace a))
(printf "Base phase: ~a~%" (namespace-base-phase ns))
(printf "Eval: ~a~%" (eval '(list x) ns))

;; tmp2.rkt
#lang racket

(require (for-syntax "tmp.rkt"))


If I run `racket tmp.rkt`, then it prints
Base phase: 0
Eval: (1)

If I run `racket tmp2.rkt`, then I get
Base phase: 1
list: unbound identifier in the transformer environment;
 also, no #%app syntax transformer is bound
  at: list
  in: (list x)
  context...:
   /Users/rohin/Documents/research/incremental/full-example/tmp2.rkt: [running 
body]
   standard-module-name-resolver

(Yes, I could probably do this without `eval`, but I already know how `eval` 
works and want to get a proof of concept working whereas doing the same thing 
with macros would probably take me a while.)

Thanks!
Rohin

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to