diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2022-06-21 17:40:16 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2022-06-21 17:40:16 -0700 |
| commit | a4fc91d5f155ef62d2b62f8279a4bf65a9050896 (patch) | |
| tree | 721b5a1dadfc862b61cd5a49fdd1b375ac457455 /csc/cps.csc | |
| parent | 3788d0a175b9372b3f39bc10e5462f567000c987 (diff) | |
| download | chromatopelma-a4fc91d5f155ef62d2b62f8279a4bf65a9050896.tar.zst | |
Start CPS :)
Diffstat (limited to 'csc/cps.csc')
| -rw-r--r-- | csc/cps.csc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/csc/cps.csc b/csc/cps.csc new file mode 100644 index 0000000..561a698 --- /dev/null +++ b/csc/cps.csc @@ -0,0 +1,22 @@ +(define-library (csc cps) + (import (only (csc ir1) + make-constant + constant? + lexical-ref? + library-ref?) + (only (csc ir2) + (make-atom)) + (scheme base)) + (begin + + + (define (to-cps expr k) + (cond + ((or (constant? expr) + (lexical-ref? expr) + (library-ref? expr)) + (make-atom expr continuation)) + (else (error "unexpected type in to-cps" expr)))) + + + (define (ir1->ir2 program) |
