On Fri, Feb 15, 2019 at 11:50 PM David Storrs <david.sto...@gmail.com>
wrote:

>
> #lang racket
> (require (for-syntax racket/syntax syntax/parse))
>
> (define-syntax (struct++ stx)
>   (syntax-parse stx
>     [(_ name:id (field:id ...) (~optional (rule:expr ...)) opt ...)
>      #'(begin (struct name (field ...) opt ...)
>             (list (~? rule) ... ))]))
>
>
I think this does what you want:
   (list (~? (~@ rule ...)))

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to