[racket] syntax-parse form at runtime

From: antoine (antoine597 at gmail.com)
Date: Wed Aug 28 16:59:04 EDT 2013


I would like play with macros, and for keep it as simple as possible i 
to work with macro at runtime, i just pass the arguments encapsulated in a
syntax object.

But with the code under i get :

test.rkt:8:16: syntax-parse: literal is unbound in phase 0 (phase 0 
relative to the enclosing module)
   at: abc
   in: (syntax-parse stx #:literals (abc) ((abc elem:id ...+) (syntax 1)))

Could you help me to decypher it ?

I far as i understand it seems the '#:literals (abc)' put this into a 
'literal' which is not available at runtime.

Thank you.

#lang racket


(define (parse-a stx)
   (syntax-parse stx
     #:literals (abc)
     [(abc elem:id ...+)

(parse-a #'(abc a b c))

Posted on the users mailing list.