[plt-scheme] how to quote identifier in macro

From: YC (yinso.chen at gmail.com)
Date: Thu Dec 11 19:29:12 EST 2008

On Thu, Dec 11, 2008 at 3:32 PM, Andre Mayers
<andre.mayers at usherbrooke.ca>wrote:

>  Eureka. It works.
>
> Now how to get rid of eval ?
>
As Noel said, try to write what you want as the final result, instead of
using list & list* to create the expression and then eval it.

As an example, the following creates a lambda without list, list*, and eval.

(define-syntax (tada2 stx)
  (syntax-case stx ()
    ((_ a1 a2 ...)
     #'(lambda (a1 a2 ...)
         (list a1 a2 ... 'a1 'a2 ...)))))

((tada2 a b c) 1 2 3) ;; => ??

HTH,
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20081211/23b3f651/attachment.html>

Posted on the users mailing list.