[racket] Eval on quasiquoted expression
Thanks!
Calling the current-namespace did the trick.
On Fri, Jul 2, 2010 at 1:15 PM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> Does setting the "current-namespace" parameter fix it for you?
> #lang scheme/base
>
> (define my-namespace (make-base-namespace))
>
>
> (define (tree->proc tree symbol)
> (parameterize ((current-namespace my-namespace))
> (eval `(lambda (,symbol) ,tree))))
>
> ((tree->proc '(+ x (* 3 (* x x))) 'x) 42)
> ;; ==> 5334
>
> Also, a comma was missing in the original example.
>
> --
> http://www.neilvandyke.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100702/9be1d09e/attachment.html>