The (namespace-require 'scheme/base) worked fine. Is there any advantage/disadvantage to using the private namespace as Eli suggested?<br><br><div class="gmail_quote">On Thu, Jul 3, 2008 at 1:19 PM, Eli Barzilay <<a href="mailto:eli@barzilay.org">eli@barzilay.org</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Jul 3, Robby Findler wrote:<br>
> This is not a bug.<br>
><br>
> The top-level namespace (ie the part of the namespace that deals<br>
> with code outside modules) for the module language does not have any<br>
> bindings. You have to initialize it with some if you want to use<br>
> them.<br>
><br>
> It would be better to avoid eval (as has been mentioned a few times<br>
> on this list) but on the assumption that eval is truely necessary,<br>
> try this:<br>
><br>
> #lang scheme<br>
> (namespace-require 'scheme/base)<br>
> (eval '((lambda (x) x) 1))<br>
><br>
> Without the second line, the third one won't work, but with it, it<br>
> does.<br>
<br>
</div>You can also use a private namespace<br>
<br>
#lang scheme<br>
(define ns (make-base-namespace))<br>
(eval '((lambda (x) x) 1) ns)<br>
<br>
or even better, you can use the namespace of the current module:<br>
<br>
#lang scheme<br>
(define-namespace-anchor anchor)<br>
(eval '((lambda (x) x) 1) (namespace-anchor->namespace anchor))<br>
<br>
and you can even do this now:<br>
<br>
#lang scheme<br>
(define-namespace-anchor anchor)<br>
(define c 1)<br>
(eval '((lambda (x) x) c) (namespace-anchor->namespace anchor))<br>
<font color="#888888"><br>
--<br>
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:<br>
<a href="http://www.barzilay.org/" target="_blank">http://www.barzilay.org/</a> Maze is Life!<br>
</font></blockquote></div><br>