From 85a74f3a1e371557538e984a2527638846976a24 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 25 May 2017 16:20:10 +0000 Subject: [PATCH] WIP --- scheme/cyclone/cps-optimizations.sld | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/scheme/cyclone/cps-optimizations.sld b/scheme/cyclone/cps-optimizations.sld index caaaae7e..0913dd7c 100644 --- a/scheme/cyclone/cps-optimizations.sld +++ b/scheme/cyclone/cps-optimizations.sld @@ -847,8 +847,27 @@ (with-fnc (ast:lambda-id (car exp)) (lambda (fnc) (adbf:side-effects fnc)))) ) - ;(let ((if-fnc (adb:get/default (ast:lambda-body (car exp)) - (trace:error `(DEBUG if inline candidate ,exp)) +;(trace:error `(DEBUG2 ,(car (ast:lambda-body (car exp))))) + (let* ((new-exp (car (ast:lambda-body (cadr exp)))) + (new-if (car (ast:lambda-body (car exp)))) +; TODO: No, just replace K with values + ;(new-if `(if ,(if->condition old-if) + ; ,(cadr (if->then old-if)) + ; ,(cadr (if->else old-if)))) + (old-k (car (ast:lambda-formals->list (car exp)))) + (old-arg (car (ast:lambda-formals->list (cadr exp)))) + ) + (trace:error `(DEBUG if inline candidate + ,exp + old-k: + ,old-k + old-arg: + ,old-arg + new-if: + ,new-if + new-exp: + ,new-exp + ))) ;; TODO: behavior would be: ;; - simplify calling lambda's if to remove cont