tiny refactoring

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

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

Loading…
Cancel
Save