[plt-scheme] Re: question of a casual drscheme (v. 424) user

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Mar 17 15:55:14 EDT 2010

On Mar 18, Benjamin L. Russell wrote:
> As mentioned in "[plt-scheme] Problems with eval" (see
> http://list.cs.brown.edu/pipermail/plt-scheme/2008-July/025698.html,
> dated "Thu Jul 3 14:34:04 EDT 2008," by Robby Findler), in the following
> example, "[w]ithout the second line, the third won't work, but with it,
> it does":
>   #lang scheme
>   (namespace-require 'scheme/base)
>   (eval '((lambda (x) x) 1))
> However, the second line is not explicitly mentioned in the
> referenced section of the Guide
> (http://docs.plt-scheme.org/guide/eval.html).
> It might be useful to add it to that section.

The way(s) to use `eval' that are mentioned in the guide page are much
better than the above.  That line is basically modifying whatever
namespace happens to be the current one at the point where the code
runs, so probably the only way to make it into a sane example would be
to wrap it all in code that creates a new namespace or uses a known
one -- but that's essentially what the guide page does describe.

(See also Matthew's later reply regarding this at

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the users mailing list.