From 285f02158df54f78e7d05347d447f1a6aef8c56b Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 7 Mar 2016 23:45:01 -0500 Subject: [PATCH] WIP --- debug/compilation/tmp.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/debug/compilation/tmp.scm b/debug/compilation/tmp.scm index fd763223..803fb27d 100644 --- a/debug/compilation/tmp.scm +++ b/debug/compilation/tmp.scm @@ -83,6 +83,7 @@ (error "unknown ast" ast)))) (define (cps-list asts inner) +(trace:error `(cps-list ,asts ,inner)) (define (body x) (cps-list (cdr asts) (lambda (new-asts) @@ -93,6 +94,10 @@ ((or (const? (car asts)) (ref? (car asts))) (body (car asts))) + ;; testing, probably won't work if prim calls into a cont + ;((prim-call? (car asts)) + ; (body (car asts))) ;; TODO: does nothing, not what we want! + ;; END testing (else (let ((r (gensym 'r))) (cps (car asts) @@ -133,3 +138,11 @@ (my-cps-convert '((define test (lambda (a$3 b$2 c$1) (write (cons (+ a$3 b$2 c$1) (- a$3 b$2 c$1))))) ((lambda () 0 (test 1 2 3)))) )) + +(trace:error + (my-cps-convert + '((define test (lambda (a$3 b$2 c$1) (write + (cons + ((lambda (x y z) (list x y z)) 1 2 3) + (cons (+ a$3 b$2 c$1) (- a$3 b$2 c$1))))) ((lambda () 0 (test 1 2 3)))) +)))