aboutsummaryrefslogtreecommitdiffstats
path: root/csc/cps.csc
blob: 561a6984ed5eba596741befadad9a156c4c466ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)