[racket] syntax-parse form at runtime

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

Hello,

I would like play with macros, and for keep it as simple as possible i 
decided
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 
binding
'literal' which is not available at runtime.

Thank you.

;;----test.rkt----
#lang racket

(require
  syntax/parse)

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

(parse-a #'(abc a b c))
;;----test.rkt----


Posted on the users mailing list.