mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 16:57:35 +02:00
WIP
This commit is contained in:
parent
732535ab2f
commit
e31b357f4c
3 changed files with 10 additions and 35 deletions
|
@ -424,7 +424,9 @@
|
||||||
(trace:info (ast:ast->pp-sexp input-program))
|
(trace:info (ast:ast->pp-sexp input-program))
|
||||||
)
|
)
|
||||||
|
|
||||||
;; TODO: would want to introduce lets right here, at least to start
|
(set! input-program (opt:local-var-reduction input-program))
|
||||||
|
(trace:info "---------------- after local variable reduction")
|
||||||
|
(trace:info (ast:ast->pp-sexp input-program))
|
||||||
|
|
||||||
;; TODO: could do this, but it seems like a bit of a band-aid...
|
;; TODO: could do this, but it seems like a bit of a band-aid...
|
||||||
(set! input-program (opt:renumber-lambdas! input-program))
|
(set! input-program (opt:renumber-lambdas! input-program))
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
;; typically be limited to if expressions embedded in other expressions.
|
;; typically be limited to if expressions embedded in other expressions.
|
||||||
(define (opt:local-var-reduction sexp)
|
(define (opt:local-var-reduction sexp)
|
||||||
(define (scan exp)
|
(define (scan exp)
|
||||||
(write `(DEBUG scan ,exp)) (newline)
|
;;(write `(DEBUG scan ,exp)) (newline)
|
||||||
(cond
|
(cond
|
||||||
((ast:lambda? exp)
|
((ast:lambda? exp)
|
||||||
(ast:%make-lambda
|
(ast:%make-lambda
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
(call/cc
|
(call/cc
|
||||||
(lambda (return)
|
(lambda (return)
|
||||||
(define (scan exp fail?)
|
(define (scan exp fail?)
|
||||||
(write `(DEBUG lvr:local-tail-call-only? scan ,exp)) (newline)
|
;;(write `(DEBUG lvr:local-tail-call-only? scan ,exp)) (newline)
|
||||||
(cond
|
(cond
|
||||||
((ast:lambda? exp)
|
((ast:lambda? exp)
|
||||||
(return #f)) ;; Could be OK if not ref'd...
|
(return #f)) ;; Could be OK if not ref'd...
|
||||||
|
@ -112,7 +112,7 @@
|
||||||
(call/cc
|
(call/cc
|
||||||
(lambda (return)
|
(lambda (return)
|
||||||
(define (scan exp)
|
(define (scan exp)
|
||||||
(write `(DEBUG scan ,exp)) (newline)
|
;;(write `(DEBUG scan ,exp)) (newline)
|
||||||
(cond
|
(cond
|
||||||
((ast:lambda? exp)
|
((ast:lambda? exp)
|
||||||
(return #f)) ;; Could be OK if not ref'd...
|
(return #f)) ;; Could be OK if not ref'd...
|
||||||
|
@ -235,38 +235,11 @@
|
||||||
row$78$676))
|
row$78$676))
|
||||||
(make-vector number-of-cols$68$671)))))))
|
(make-vector number-of-cols$68$671)))))))
|
||||||
(length first-row$65$670)))
|
(length first-row$65$670)))
|
||||||
'now)))))
|
'now))))
|
||||||
|
(define *num-passed* 0)
|
||||||
|
)
|
||||||
|
|
||||||
)
|
)
|
||||||
#;(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)))))))
|
|
||||||
|
|
||||||
;(pretty-print
|
;(pretty-print
|
||||||
; (ast:ast->pp-sexp
|
; (ast:ast->pp-sexp
|
||||||
; (ast:sexp->ast sexp)))
|
; (ast:sexp->ast sexp)))
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
(define-library (scheme cyclone cps-optimizations)
|
(define-library (scheme cyclone cps-optimizations)
|
||||||
(import (scheme base)
|
(import (scheme base)
|
||||||
(scheme eval)
|
(scheme eval)
|
||||||
;(scheme write)
|
(scheme write)
|
||||||
(scheme cyclone util)
|
(scheme cyclone util)
|
||||||
(scheme cyclone ast)
|
(scheme cyclone ast)
|
||||||
(scheme cyclone primitives)
|
(scheme cyclone primitives)
|
||||||
|
|
Loading…
Add table
Reference in a new issue