<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Are my docs incorrect or out outdated?<br><br>Michael<br><br>===================<br><br>From: file:///usr/share/plt/doc/guide/eval.html#%28tech._current._namespace%29<br><br>#lang scheme<br> <br> (eval '(cons 1 2))<br><br>This fails because the initial current namespace is empty. When you run mzscheme in interactive mode (see Interactive Mode), the initial namespace is initialized with the exports of the scheme module, but when you run a module directly, the initial namespace starts empty.<br><br>In general, it’s a bad idea to use eval with whatever namespace happens to be installed. Instead, create a namespace explicitly and install it for the call to eval:<br><br> #lang scheme<br> <br> (define ns (make-base-namespace))<br> (eval '(cons 1 2) ns) ; works<br><br><br>--- On <b>Thu, 6/24/10, Noel Welsh
<i><noelwelsh@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Noel Welsh <noelwelsh@gmail.com><br>Subject: Re: [racket] Need a namespace<br>To: "michael rice" <nowgate@yahoo.com><br>Cc: users@racket-lang.org<br>Date: Thursday, June 24, 2010, 11:27 AM<br><br><div class="plainMail">You're using a define in a place where you aren't allowed to put a<br>define. E.g., this will work:<br><br>(define foo 1)<br><br>This won't work:<br><br>(define bar (define foo 1) foo)<br><br>N.<br></div></blockquote></td></tr></table><br>