mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 16:27:35 +02:00
WIP
This commit is contained in:
parent
285f02158d
commit
3f2bddea8b
1 changed files with 7 additions and 9 deletions
|
@ -83,7 +83,7 @@
|
||||||
(error "unknown ast" ast))))
|
(error "unknown ast" ast))))
|
||||||
|
|
||||||
(define (cps-list asts inner)
|
(define (cps-list asts inner)
|
||||||
(trace:error `(cps-list ,asts ,inner))
|
;(trace:error `(cps-list ,asts ,inner))
|
||||||
(define (body x)
|
(define (body x)
|
||||||
(cps-list (cdr asts)
|
(cps-list (cdr asts)
|
||||||
(lambda (new-asts)
|
(lambda (new-asts)
|
||||||
|
@ -95,8 +95,9 @@
|
||||||
(ref? (car asts)))
|
(ref? (car asts)))
|
||||||
(body (car asts)))
|
(body (car asts)))
|
||||||
;; testing, probably won't work if prim calls into a cont
|
;; testing, probably won't work if prim calls into a cont
|
||||||
;((prim-call? (car asts))
|
((prim-call? (car asts))
|
||||||
; (body (car asts))) ;; TODO: does nothing, not what we want!
|
(body (car asts))
|
||||||
|
) ;; TODO: does nothing, not what we want!
|
||||||
;; END testing
|
;; END testing
|
||||||
(else
|
(else
|
||||||
(let ((r (gensym 'r)))
|
(let ((r (gensym 'r)))
|
||||||
|
@ -136,13 +137,10 @@
|
||||||
|
|
||||||
(trace:error
|
(trace:error
|
||||||
(my-cps-convert
|
(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))))
|
'(write (cons (list (list 1 2 3)) (cons 2 3)))
|
||||||
))
|
))
|
||||||
|
|
||||||
(trace:error
|
(trace:error
|
||||||
(my-cps-convert
|
(my-cps-convert
|
||||||
'((define test (lambda (a$3 b$2 c$1) (write
|
'(list
|
||||||
(cons
|
(list 1 2 3))))
|
||||||
((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))))
|
|
||||||
)))
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue