compile the left-hand sides of define-judgment only once, not during each time we try to check a judgment

related to PR 12380
This commit is contained in:
Robby Findler 2011-11-17 20:47:31 -06:00
parent 2d0fa3a60b
commit b93486ed69

View File

@ -1891,10 +1891,12 @@
(for ([output outputs]) (for ([output outputs])
(check-judgment-form-contract `#,name output compiled-output-ctcs 'O '#,mode)) (check-judgment-form-contract `#,name output compiled-output-ctcs 'O '#,mode))
outputs))))])) outputs))))]))
(with-syntax ([(clause-proc ...) (map compile-clause clauses)]) (with-syntax ([(clause-proc ...) (map compile-clause clauses)]
#'(λ (input) [(clause-proc-ids ...) (generate-temporaries clauses)])
(for/fold ([outputs '()]) ([rule (list clause-proc ...)]) (with-syntax ([(backwards-ids ...) (reverse (syntax->list #'(clause-proc-ids ...)))])
(append (rule input) outputs))))) #'(let ([clause-proc-ids clause-proc] ...)
(λ (input)
(append (backwards-ids input) ...))))))
(define-for-syntax (do-compile-judgment-form-lws clauses) (define-for-syntax (do-compile-judgment-form-lws clauses)
(syntax-case clauses () (syntax-case clauses ()