From 8f5308de376d6c8d2cd090e0f160e2c271fe2456 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Fri, 3 Jun 2016 00:03:20 -0400 Subject: [PATCH] Added notes --- test-cps.scm | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/test-cps.scm b/test-cps.scm index d33bf8b5..3151b724 100644 --- a/test-cps.scm +++ b/test-cps.scm @@ -26,3 +26,83 @@ ;; add them directly to calling lambda's? (pretty-print (cps-convert code)) + + +((lambda (result) + ) + (prim ...)) + +can we convert that to (assuming prim does not require a continuation): + + + + 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)))))