Re: [racket] Abstract datum literal out of syntax class

2014-02-17 Thread Jonathan Schuster
Asumu found a solution that works reasonably well: (define-splicing-syntax-class (maybe-clause expected-clause-name default-value) #:attributes (ast) (pattern (clause-name elements ...) #:when (eq? (syntax-e #'clause-name) (syntax-e expected-clause-name)) #:attr ast #'(cl

[racket] Abstract datum literal out of syntax class

2014-02-17 Thread Jonathan Schuster
Is there a way to abstract datum literals out of a (splicing) syntax class? I have a number of patterns that look something like this: (~optional (clause-name: element ...)) and I'd like to factor that out into a common syntax class, but be able to specialize it according to the specific clause n