Factor out parts of syntax templates

Using quasi-syntax is probably what you are looking for.

#lang racket

(require (for-syntax syntax/parse))

(define-for-syntax (helper stx-fragment)
  #`(list #,@stx-fragment))

(define-syntax main-macro
  (syntax-parser
    [(_ stuff ...)
     (helper #'(stuff ...))]))

(main-macro 'a 'b 'c 'd)
4 Likes