On Thu, 20 Nov 2014 15:54:58 +
Sam Tobin-Hochstadt
wrote:
> On Thu Nov 20 2014 at 10:42:08 AM Benjamin Greenman
> wrote:
>
> > But why does eval's default namespace include "+" but not "expt"?
> >
>
> It doesn't include either `+` or `expt`. The initial value for
> `current-namespace` insi
On Thu Nov 20 2014 at 10:42:08 AM Benjamin Greenman
wrote:
> But why does eval's default namespace include "+" but not "expt"?
>
It doesn't include either `+` or `expt`. The initial value for
`current-namespace` inside a module is an empty namespace.
Sam
Racket Users list
2014-11-20 16:26 GMT+01:00 Manfred Lotz :
> 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
Since the value of p1 is '(expt 2 3) eval will evaluate '(expt 2 3) in the
current namespace. In the repl the current namespace i
But why does eval's default namespace include "+" but not "expt"?
On Thu, Nov 20, 2014 at 10:39 AM, Éric Tanter wrote:
> This is answered in the Racket Guide, see section 15.1.
>
> The reason is that you need to provide a namespace (which in the
> interaction mode is already initialized).
>
> So
This is answered in the Racket Guide, see section 15.1.
The reason is that you need to provide a namespace (which in the interaction
mode is already initialized).
So if you do:
#lang racket/base
(define ns (make-base-namespace)) ; create namespace
(define p1 '(a . (expt 2 3)))
(eval (cdr p1) ns
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 wor
Eli Barzilay writes:
> About a minute ago, prad wrote:
>> if i run the last line in the repl, it works.
>> however, if i just try to run the program i the following error:
>>
>> compile: unbound identifier (and no #%app syntax transformer is bound)
>> at: display in: (display phr)
>>
>> so it s
About a minute ago, prad wrote:
> if i run the last line in the repl, it works.
> however, if i just try to run the program i the following error:
>
> compile: unbound identifier (and no #%app syntax transformer is bound)
> at: display in: (display phr)
>
> so it seems that it doesn't recognize t
8 matches
Mail list logo