[plt-scheme] how to quote identifier in macro

From: Andre Mayers (andre.mayers at usherbrooke.ca)
Date: Thu Dec 11 18:32:23 EST 2008

Eureka. It works. 

Now how to get rid of eval ?

 

De : plt-scheme-bounces at list.cs.brown.edu [mailto:plt-scheme-bounces at list.cs.brown.edu] De la part de YC
Envoyé : December-11-08 5:37 PM
À : andre.mayers at usherbrooke.ca
Cc : pltscheme
Objet : Re: [plt-scheme] how to quote identifier in macro

 

 

2008/12/11 Andre Mayers <andre.mayers at usherbrooke.ca>

 

(define slot-value

  (λ (slot-name objet)
   (cadr (assq (quote slot-name) objet))))


The (quote slot-name) is most likely redundant.
 


(define-syntax (tata stx)
 (syntax-case stx ()
   [(_ a v (s ps ...) body ...)
    (syntax
;      (eval
      (list 'λ '(self ps ...)
                 (list* 'let (map (λ (p-attr)
                                    (list p-attr

                                          (list slot-value (quote p-attr)

'self)))
                                  a)
                        '(body ...)))


Try 

`(quote ,p-attr) 

instead of 

(quote p-attr)



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20081211/249c5194/attachment.html>

Posted on the users mailing list.