Real fix for the issue in the math docs
Commit 92b0e86ed1
turns
out to have been the wrong approach, because there was no mysterious
performance problem with TR. Instead, TR's `define` expanded to new
code that interacted poorly with a macro used in the math docs.
I've kept the refactoring from that commit because I think it still
makes the code clearer, but I've removed the now extraneous comment.
This commit is contained in:
parent
9e9cc90af8
commit
8a93eeb52b
|
@ -9,11 +9,13 @@
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(_ e)
|
[(_ e)
|
||||||
(let ([expanded (local-expand #'e (syntax-local-context) #f)])
|
(let ([expanded (local-expand #'e (syntax-local-context) #f)])
|
||||||
(syntax-case expanded (define-values)
|
(syntax-case expanded (define-values begin)
|
||||||
[(define-values (x ...) expr)
|
[(define-values (x ...) expr)
|
||||||
(with-syntax ([(y ...) (generate-temporaries #'(x ...))])
|
(with-syntax ([(y ...) (generate-temporaries #'(x ...))])
|
||||||
(syntax/loc stx
|
(syntax/loc stx
|
||||||
(begin
|
(begin
|
||||||
(define-syntax x (make-rename-transformer #'y)) ...
|
(define-syntax x (make-rename-transformer #'y)) ...
|
||||||
(define-values (y ...) expr))))]
|
(define-values (y ...) expr))))]
|
||||||
|
[(begin e ...)
|
||||||
|
#'(begin (rename-defines e) ...)]
|
||||||
[_ #'e]))]))
|
[_ #'e]))]))
|
||||||
|
|
|
@ -1221,10 +1221,6 @@ This file defines two sorts of primitives. All of them are provided into any mod
|
||||||
;; the first three cases are actually subsumed by the last,
|
;; the first three cases are actually subsumed by the last,
|
||||||
;; but manually expanding to using the : annotation form
|
;; but manually expanding to using the : annotation form
|
||||||
;; produces better error messages on duplicate annotations
|
;; produces better error messages on duplicate annotations
|
||||||
;;
|
|
||||||
;; note, these first two cases can be collapsed into one
|
|
||||||
;; but we keep them separate because in some cases it ruins
|
|
||||||
;; typechecking performance to merge them.
|
|
||||||
[(-define nm:id body)
|
[(-define nm:id body)
|
||||||
(syntax/loc stx (define nm body))]
|
(syntax/loc stx (define nm body))]
|
||||||
[(-define nm:id return:return-ann body)
|
[(-define nm:id return:return-ann body)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user