diff --git a/scheme/cyclone/cps-opt-local-var-redux.scm b/scheme/cyclone/cps-opt-local-var-redux.scm index 026eeef6..80541fd1 100644 --- a/scheme/cyclone/cps-opt-local-var-redux.scm +++ b/scheme/cyclone/cps-opt-local-var-redux.scm @@ -21,6 +21,7 @@ ;; typically be limited to if expressions embedded in other expressions. (define (opt:local-var-reduction sexp) (define (scan exp) + (write `(DEBUG scan ,exp)) (newline) (cond ((ast:lambda? exp) (ast:%make-lambda @@ -34,7 +35,7 @@ ((define? exp) `(define ,(define->var exp) - ,(map scan (define->exp exp)))) + ,@(map scan (define->exp exp)))) ((set!? exp) `(set! ,(set!->var exp) @@ -77,6 +78,7 @@ (call/cc (lambda (return) (define (scan exp fail?) + (write `(DEBUG lvr:local-tail-call-only? scan ,exp)) (newline) (cond ((ast:lambda? exp) (return #f)) ;; Could be OK if not ref'd... @@ -110,7 +112,7 @@ (call/cc (lambda (return) (define (scan exp) - ;;(write `(DEBUG scan ,exp)) (newline) + (write `(DEBUG scan ,exp)) (newline) (cond ((ast:lambda? exp) (return #f)) ;; Could be OK if not ref'd... @@ -140,7 +142,103 @@ (cond-expand (program (define sexp - '(lambda +'( + (define zunda + ((lambda + (k$1057 first-row-perm$61$668 mat$62$669) + (first-row-perm$61$668 + (lambda + (first-row$65$670) + ((lambda + (number-of-cols$68$671) + ((lambda + (make-row->func$71$672) + (first-row-perm$61$668 + (lambda + (r$1062) + (make-row->func$71$672 + (lambda + (r$1063) + (make-row->func$71$672 + (lambda + (r$1064) + (zebra k$1057 + r$1062 + r$1063 + r$1064 + (cdr mat$62$669) + number-of-cols$68$671)) + -1 + 1)) + 1 + -1)) + 'child)) + (lambda + (k$1066 if-equal$76$674 if-different$77$675) + (k$1066 + (lambda + (k$1067 row$78$676) + ((lambda + (vec$79$677) + ((lambda + (first$85$679 row$86$680) + ((lambda + (lp$80$87$681) + ((lambda + (lp$80$87$681) + (Cyc-seq + (set-cell! + lp$80$87$681 + (lambda + (k$1073 i$88$682 first$89$683 row$90$684) + (if (Cyc-fast-eq + i$88$682 + number-of-cols$68$671) + (k$1073 + (Cyc-fast-eq + i$88$682 + number-of-cols$68$671)) + ((lambda + (k$1080) + (if (Cyc-fast-eq + + (car first$89$683) + (car row$90$684)) + (k$1080 if-equal$76$674) + (k$1080 if-different$77$675))) + (lambda + (r$1079) + (Cyc-seq + (vector-set! + vec$79$677 + i$88$682 + r$1079) + ((cell-get lp$80$87$681) + k$1073 + (Cyc-fast-plus i$88$682 1) + (cdr first$89$683) + (cdr row$90$684)))))))) + ((cell-get lp$80$87$681) + (lambda + (r$1069) + (k$1067 + (lambda + (k$1070 i$92$686) + (k$1070 + (vector-ref vec$79$677 i$92$686))))) + 0 + first$85$679 + row$86$680))) + (cell lp$80$87$681))) + #f)) + first-row$65$670 + row$78$676)) + (make-vector number-of-cols$68$671))))))) + (length first-row$65$670))) + 'now))))) + +) + #;(lambda (k$1073 i$88$682 first$89$683 row$90$684) (if (Cyc-fast-eq i$88$682 @@ -167,7 +265,7 @@ k$1073 (Cyc-fast-plus i$88$682 1) (cdr first$89$683) - (cdr row$90$684)))))))) + (cdr row$90$684))))))) ;(pretty-print ; (ast:ast->pp-sexp @@ -175,5 +273,6 @@ (pretty-print (ast:ast->pp-sexp - (opt:local-var-reduction (ast:sexp->ast sexp)))) + (opt:local-var-reduction (ast:sexp->ast sexp))) + ) ))