[racket] Unquote symbol outside quasiquote

From: André Matheus (amatheus at mac.com)
Date: Tue Sep 4 15:30:48 EDT 2012

Hi everyone,

I want to create a macro to get fields of an object specified by a list of symbols. Like

    (get-fields '(x y) obj) -> (list (get-field x obj) (get-field y obj))

Now, my macro will receive (quote x) and (quote y), for example. What I want to know
is, what is the right way to unquote it? Using eval as in

    (datum->syntax #'lex `(get-field ,(eval (second (syntax->datum #'(get-fields 'y xx)))) xx) #'srcloc)

removes the quote but I don't think it's the right way to do it.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120904/71830c4e/attachment-0001.html>

Posted on the users mailing list.