Test optimization changes

This commit is contained in:
Justin Ethier 2016-03-11 02:19:20 -05:00
parent 4e9a209f43
commit 4c2b56b19e

View file

@ -1458,9 +1458,10 @@
ast)
(else
(cps ast '%halt)))))
ast-cps))
; ast-cps))
;; TODO: use for temporary testing of optimizations
; (cps-optimize-01 ast-cps)))
;; eventually will want to call this explicitly from cyclone.scm
(cps-optimize-01 ast-cps)))
;; CPS optimizations
@ -1469,13 +1470,13 @@
(define (cps-optimize-01 exp)
(define (opt-lambda exp)
(let ((body (car (lambda->exp exp)))) ;; Single expr after CPS
(trace:error `(DEBUG
,exp
,body
,(if (and (pair? body) (app? body) (lambda? (car body)))
(list (app->args body)
(lambda->formals exp))
#f)))
;(trace:error `(DEBUG
; ,exp
; ,body
; ,(if (and (pair? body) (app? body) (lambda? (car body)))
; (list (app->args body)
; (lambda->formals exp))
; #f)))
(cond
;; Does the function just call its continuation?
((and (pair? body)