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