mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 13:05:05 +02:00
Added notes
This commit is contained in:
parent
1c7b33b028
commit
8f5308de37
1 changed files with 80 additions and 0 deletions
80
test-cps.scm
80
test-cps.scm
|
@ -26,3 +26,83 @@
|
||||||
;; add them directly to calling lambda's?
|
;; add them directly to calling lambda's?
|
||||||
(pretty-print
|
(pretty-print
|
||||||
(cps-convert code))
|
(cps-convert code))
|
||||||
|
|
||||||
|
|
||||||
|
((lambda (result)
|
||||||
|
<lambda-body>)
|
||||||
|
(prim ...))
|
||||||
|
|
||||||
|
can we convert that to (assuming prim does not require a continuation):
|
||||||
|
|
||||||
|
<lambda-body>
|
||||||
|
|
||||||
|
with `(prim ...)` replacing any occurences of `result`.
|
||||||
|
|
||||||
|
then, what would this look like? ->
|
||||||
|
also, what does it mean for other phases after CPS?
|
||||||
|
at a minimum, it is going to require changes to the cgen phase because that
|
||||||
|
makes some assumptions about there only being one prim per function, I believe
|
||||||
|
|
||||||
|
;; Original:
|
||||||
|
#;(#((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(6
|
||||||
|
()
|
||||||
|
((#((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(5
|
||||||
|
(r$2)
|
||||||
|
((#((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(4
|
||||||
|
(x$3 y$2 z$1)
|
||||||
|
((#((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(3
|
||||||
|
(r$4)
|
||||||
|
((#((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(2
|
||||||
|
(r$3)
|
||||||
|
((write #((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(1 (r$1) ((r$1 %halt))))
|
||||||
|
r$3))))
|
||||||
|
(cons x$3 r$4)))))
|
||||||
|
(cons y$2 z$1)))))
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3))))
|
||||||
|
0)))))
|
||||||
|
|
||||||
|
;; TODO: update
|
||||||
|
#;(#((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(6
|
||||||
|
()
|
||||||
|
((#((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(5
|
||||||
|
(r$2)
|
||||||
|
((#((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(4
|
||||||
|
(x$3 y$2 z$1)
|
||||||
|
((#((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(3
|
||||||
|
(r$4)
|
||||||
|
((#((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(2
|
||||||
|
(r$3)
|
||||||
|
((write #((record-marker)
|
||||||
|
#((record-marker) #f (id args body))
|
||||||
|
#(1 (r$1) ((r$1 %halt))))
|
||||||
|
r$3))))
|
||||||
|
(cons x$3 r$4)))))
|
||||||
|
(cons y$2 z$1)))))
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3))))
|
||||||
|
0)))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue