mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-11 23:07:36 +02:00
Initial file
This commit is contained in:
parent
5f5bfb7290
commit
1c7b33b028
1 changed files with 28 additions and 0 deletions
28
test-cps.scm
Normal file
28
test-cps.scm
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
(import (scheme base)
|
||||||
|
(scheme write)
|
||||||
|
(scheme cyclone transforms)
|
||||||
|
(scheme cyclone pretty-print)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; Original code:
|
||||||
|
;;(let ((x 1) (y 2) (z 3))
|
||||||
|
;; (write
|
||||||
|
;; (cons
|
||||||
|
;; x
|
||||||
|
;; (cons y z))))
|
||||||
|
|
||||||
|
(define code
|
||||||
|
'(((lambda ()
|
||||||
|
0
|
||||||
|
((lambda (x$3 y$2 z$1)
|
||||||
|
(write (cons x$3 (cons y$2 z$1))))
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3))))
|
||||||
|
)
|
||||||
|
|
||||||
|
;; thought - can either CPS or CPS-opti convert the CPS code
|
||||||
|
;; to prevent wrapping non-cont prims in functions, but just
|
||||||
|
;; add them directly to calling lambda's?
|
||||||
|
(pretty-print
|
||||||
|
(cps-convert code))
|
Loading…
Add table
Reference in a new issue