tiny refactoring

dev-elider-3
Matthew Butterick 9 years ago
parent f4b52138f3
commit 509c9000ab

@ -200,15 +200,14 @@
(define+provide arg ...)) (define+provide arg ...))
(define-for-syntax (expand-macro mac)
(syntax-disarm (local-expand mac 'expression #f) #f))
(br:define #'(define-inverting (syntax (_id . _patargs)) _syntaxexpr) (br:define #'(define-inverting (syntax (_id . _patargs)) _syntaxexpr)
#'(define-syntax (_id stx) #'(br:define (syntax (_id . rest))
(let () (with-syntax ([_patargs (map expand-macro (syntax->list #'rest))])
(define (expand-macro mac) _syntaxexpr)))
(syntax-disarm (local-expand mac 'expression #f) #f))
(syntax-case stx ()
[(_ . rest)
(with-syntax ([_patargs (map expand-macro (syntax->list #'rest))])
_syntaxexpr)]))))
(module+ test (module+ test
;; an inverting macro expands its arguments. ;; an inverting macro expands its arguments.

Loading…
Cancel
Save