[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scm-discuss] eval couldn't bind local variable?

From: Aubrey Jaffer
Subject: Re: [Scm-discuss] eval couldn't bind local variable?
Date: Sun, 03 Apr 2011 12:12:36 -0400 (EDT)

 | From: Tom Kwong <address@hidden>
 | Date: Sat, 2 Apr 2011 17:57:57 -0700
 | I'm new to scheme but is puzzled by the following behavior.  Can
 | someone help explain what's going on here?
 | (letrec ((x 0)) (eval 'x))  
 | => unbound variable: x
 | (define a 3)
 | (letrec ((x 0)) (eval 'a))  
 | => 3

EVAL evaluates its argument in the top-level environment.
LETREC establishes a local environment for x which the call to EVAL
doesn't see.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]