[racket] Eval on quasiquoted expression

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Fri Jul 2 07:15:04 EDT 2010

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.


Posted on the users mailing list.