[racket] eval, namespaces, and the REPL
More specifically, I think section 15.1.2 of the guide addresses exactly
what you want to know. More specifically:
/quote
#lang racket
(eval '(cons 1 2))
This fails because the initial current namespace is empty. When you run
racket in interactive mode (see Interactive Mode), the initial namespace
is initialized with the exports of the racket module, but when you run a
module directly, the initial namespace starts empty.
/endquote
On 12/04/2010 10:51 AM, Patrick King wrote:
> No, I hadn't. Helps me do what want, but I still don't fully grok why it is
> so. Obviously, more reflection is required ;)
>
> Thanks, Matt
>
> On Dec 4, 2010 7:19 AM, "Matthew Flatt" <mflatt at cs.utah.edu> wrote:
>
> At Sat, 4 Dec 2010 05:43:06 -0600, Patrick King wrote:
>> Why is it that
>>
>> (eval '(+ 1 2))
>>
>> wo...
> Have you seen this already?:
>
> http://docs.racket-lang.org/guide/reflection.html
>
>
>
>
> _________________________________________________
> For list-related administrative tasks:
> http://lists.racket-lang.org/listinfo/users
--
Eduardo Bellani
omnia mutantur, nihil interit.