okay, I got it I think. (begin-for-syntax (define/contract (quotify stx) (-> (syntax/c (listof any/c)) (listof syntax?)) (map (λ (stx) (syntax-case stx () (e #'(quote e)))) (syntax->list stx))) (define/contract (splice-tf stx) (-> syntax? syntax?) (syntax-case stx () ((quote (thing ...)) (datum->syntax stx (quotify #'(thing ...)) stx)) ((list thing ...) #'(thing ...)) (thing #'(thing)))))
(define-syntax-rule (splice . stuff) (splice-aux () . stuff)) (define-syntax (splice-aux stx) (syntax-case stx (if list quote) ((splice-aux (before ...) (if test yes no) after ...) #`(if test (splice-aux (before ...) #,@(splice-tf #'yes) after ...) (splice-aux (before ...) #,@(splice-tf #'no) after ...))) ((splice-aux (before ...) clause after ...) #'(splice-aux (before ... clause) after ...)) ((splice-aux (before ...)) #'(list before ...)))) https://gist.github.com/cyisfor/121fa59b6d9543a2c84e Have fun! -- 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.