From 24dc005ff4a334bebcc161d6932567ff2813c7a2 Mon Sep 17 00:00:00 2001 From: Casey Klein Date: Fri, 22 Jul 2011 11:56:15 -0500 Subject: [PATCH] Removes special case for typesetting recursive calls This case doesn't appear necessary, since LWs are constructed in an expansion step that occurs after all of the meta-function names (including the current one) are bound. --- collects/redex/private/loc-wrapper-ct.rkt | 14 +++----------- collects/redex/private/reduction-semantics.rkt | 6 +----- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/collects/redex/private/loc-wrapper-ct.rkt b/collects/redex/private/loc-wrapper-ct.rkt index 08c1a0245e..52d330adfb 100644 --- a/collects/redex/private/loc-wrapper-ct.rkt +++ b/collects/redex/private/loc-wrapper-ct.rkt @@ -2,14 +2,7 @@ (require (for-template scheme/base) (for-template "loc-wrapper-rt.rkt") "term-fn.rkt") -(provide to-lw/proc to-lw/uq/proc is-term-fn?) - -;; this parameter allows define-metafunction to -;; communicate which name is the recursive calls -;; to the typesetting code, since the let-term-fn -;; won't have been expanded before to-lw/proc -;; is called. -(define is-term-fn? (make-parameter (λ (x) #f))) +(provide to-lw/proc to-lw/uq/proc) (define (process-arg stx quote-depth) (define quoted? (quote-depth . > . 0)) @@ -67,9 +60,8 @@ #,quoted?)] [x (and (identifier? #'x) - (or (and (syntax-transforming?) - (term-fn? (syntax-local-value #'x (λ () #f)))) - ((is-term-fn?) #'x))) + (and (syntax-transforming?) + (term-fn? (syntax-local-value #'x (λ () #f))))) #`(make-lw '#,(syntax-e #'x) #,(syntax-line stx) diff --git a/collects/redex/private/reduction-semantics.rkt b/collects/redex/private/reduction-semantics.rkt index bb2626fbf3..27891fc341 100644 --- a/collects/redex/private/reduction-semantics.rkt +++ b/collects/redex/private/reduction-semantics.rkt @@ -1242,11 +1242,7 @@ (with-syntax ([((rhs stuff ...) ...) (if relation? #'((,(and (term raw-rhses) ...)) ...) #'((raw-rhses ...) ...))]) - (parameterize ([is-term-fn? - (let ([names (syntax->list #'(original-names ...))]) - (λ (x) (and (not (null? names)) - (identifier? (car names)) - (free-identifier=? x (car names)))))]) + (parameterize () (with-syntax ([(lhs ...) #'((lhs-clauses ...) ...)] [name (let loop ([name (if contract-name contract-name