[racket] eval question

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Thu Nov 20 10:35:38 EST 2014

See the guide section on eval [1], particularly the section on namespaces.

Ryan

[1] http://docs.racket-lang.org/guide/eval.html


On 11/20/2014 10:26 AM, Manfred Lotz wrote:
> Hi there,
> If I do this in a REPL
>
> Welcome to Racket v6.1.1.
> -> (define p1 '(a . (expt 2 3)))
> -> (eval (cdr p1))
> 8
>
> it works fine
>
> If I put it in a file:
>
> #lang racket/base
> (define p1 '(a . (expt 2 3)))
> (eval (cdr p1))
>
> I get this:
>
> expt: unbound identifier;
>   also, no #%app syntax transformer is bound
>    at: expt
>    in: (expt 2 3)
>    context...:
>     /home/manfred/tmp/test.rkt:
> [running body]
>
>
> What am I doing wrong? Sorry, if this is a stupid question.
>
>
>


Posted on the users mailing list.