less slovenly

pull/174/head
Matthew Butterick 7 years ago
parent 104baa0384
commit 3ec7df6513

@ -127,20 +127,18 @@
(provide for/splice for*/splice) (provide for/splice for*/splice)
(define-syntax (for/splice stx)
(syntax-case stx ()
[(_ ([ID SEQ] ...) . BODY)
(with-syntax ([SPLICING-TAG (datum->syntax stx (setup:splicing-tag))])
#'(apply SPLICING-TAG (for/list ([ID SEQ] ...)
(SPLICING-TAG . BODY))))]))
(define-syntax (for*/splice stx) (define-syntax (for/splice/base stx)
(syntax-case stx () (syntax-case stx ()
[(_ ([ID SEQ] ...) . BODY) [(_ ([ID SEQ] ...) . BODY)
(with-syntax ([SPLICING-TAG (datum->syntax stx (setup:splicing-tag))]) (with-syntax ([SPLICING-TAG (datum->syntax stx (setup:splicing-tag))]
#'(apply SPLICING-TAG (for*/list ([ID SEQ] ...) [FORM (or (syntax-property stx 'form) #'for/list)])
(SPLICING-TAG . BODY))))])) #'(apply SPLICING-TAG (FORM ([ID SEQ] ...)
(SPLICING-TAG . BODY))))]))
(define-syntax-rule (for/splice . BODY) #'(for/splice/base . BODY))
(define-syntax-rule (for*/splice . BODY) (syntax-property #'(for/splice/base . BODY) 'form #'for*/list))
(provide when/block) ; bw compat (provide when/block) ; bw compat
(define-syntax-rule (when/block cond body ...) (define-syntax when/block (make-rename-transformer #'when/splice))
(when/splice cond body ...))

@ -1 +1 @@
1521302544 1521332679

Loading…
Cancel
Save