schmeify: improve determinism by ordering lifted procedures

This commit is contained in:
Matthew Flatt 2019-12-05 07:06:28 -07:00
parent 1083aa1317
commit 6f919635da

View File

@ -620,6 +620,7 @@
;; Create bindings for lifted functions, adding new arguments ;; Create bindings for lifted functions, adding new arguments
;; as the functions are lifted ;; as the functions are lifted
(define (extract-lifted-bindings lifts empties) (define (extract-lifted-bindings lifts empties)
(define bindings
(for/list ([(f proc) (in-hash lifts)] (for/list ([(f proc) (in-hash lifts)]
#:when (liftable? proc)) #:when (liftable? proc))
(let* ([new-args (liftable-frees proc)] (let* ([new-args (liftable-frees proc)]
@ -636,7 +637,8 @@
[body (in-list bodys)]) [body (in-list bodys)])
(let ([body (convert-lifted-calls-in-seq/box-mutated body args lifts frees empties)]) (let ([body (convert-lifted-calls-in-seq/box-mutated body args lifts frees empties)])
`[,(append new-args args) . ,body]))))])]))) `[,(append new-args args) . ,body]))))])])))
;; Improve determinsism:
(sort bindings symbol<? #:key car))
;; ---------------------------------------- ;; ----------------------------------------
;; Helpers ;; Helpers