From 3ec7df6513041b5c4d42f8bff4fd8a92e29e21d3 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 17 Mar 2018 17:24:39 -0700 Subject: [PATCH] less slovenly --- pollen/core.rkt | 22 ++++++++++------------ pollen/private/ts.rktd | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/pollen/core.rkt b/pollen/core.rkt index da11b5f..730803b 100644 --- a/pollen/core.rkt +++ b/pollen/core.rkt @@ -127,20 +127,18 @@ (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 () [(_ ([ID SEQ] ...) . BODY) - (with-syntax ([SPLICING-TAG (datum->syntax stx (setup:splicing-tag))]) - #'(apply SPLICING-TAG (for*/list ([ID SEQ] ...) - (SPLICING-TAG . BODY))))])) + (with-syntax ([SPLICING-TAG (datum->syntax stx (setup:splicing-tag))] + [FORM (or (syntax-property stx 'form) #'for/list)]) + #'(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 -(define-syntax-rule (when/block cond body ...) - (when/splice cond body ...)) +(define-syntax when/block (make-rename-transformer #'when/splice)) \ No newline at end of file diff --git a/pollen/private/ts.rktd b/pollen/private/ts.rktd index f030ab0..61ef6d2 100644 --- a/pollen/private/ts.rktd +++ b/pollen/private/ts.rktd @@ -1 +1 @@ -1521302544 +1521332679