extracting the lambda environment just once, to make it easier to work with the lam+cenv structure
This commit is contained in:
parent
956238af05
commit
e16a66f20b
|
@ -235,7 +235,7 @@
|
||||||
(loop (Branch-consequent exp) cenv)
|
(loop (Branch-consequent exp) cenv)
|
||||||
(loop (Branch-alternative exp) cenv))]
|
(loop (Branch-alternative exp) cenv))]
|
||||||
[(Lam? exp)
|
[(Lam? exp)
|
||||||
(cons (make-lam+cenv exp cenv)
|
(cons (make-lam+cenv exp (extract-lambda-cenv exp cenv))
|
||||||
(loop (Lam-body exp)
|
(loop (Lam-body exp)
|
||||||
(extract-lambda-cenv exp cenv)))]
|
(extract-lambda-cenv exp cenv)))]
|
||||||
[(CaseLam? exp)
|
[(CaseLam? exp)
|
||||||
|
@ -1022,7 +1022,7 @@
|
||||||
;; Closures will target their value to the 'val register, and use return linkage.
|
;; Closures will target their value to the 'val register, and use return linkage.
|
||||||
(define (compile-lambda-body exp cenv)
|
(define (compile-lambda-body exp cenv)
|
||||||
(parameterize ([current-lambda-being-compiled exp])
|
(parameterize ([current-lambda-being-compiled exp])
|
||||||
(define all-applications (collect-lam-applications exp (extract-lambda-cenv exp cenv)))
|
(define all-applications (collect-lam-applications exp cenv))
|
||||||
|
|
||||||
(let: ([maybe-unsplice-rest-argument : InstructionSequence
|
(let: ([maybe-unsplice-rest-argument : InstructionSequence
|
||||||
(if (Lam-rest? exp)
|
(if (Lam-rest? exp)
|
||||||
|
@ -1040,7 +1040,7 @@
|
||||||
empty-instruction-sequence)]
|
empty-instruction-sequence)]
|
||||||
[lam-body-code : InstructionSequence
|
[lam-body-code : InstructionSequence
|
||||||
(compile (Lam-body exp)
|
(compile (Lam-body exp)
|
||||||
(extract-lambda-cenv exp cenv)
|
cenv
|
||||||
'val
|
'val
|
||||||
return-linkage)])
|
return-linkage)])
|
||||||
|
|
||||||
|
|
|
@ -7,4 +7,4 @@
|
||||||
(provide version)
|
(provide version)
|
||||||
(: version String)
|
(: version String)
|
||||||
|
|
||||||
(define version "1.227")
|
(define version "1.228")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user