(define-library (csc cps) (export ir1->ir2) (import (only (csc ir1) make-constant constant? lexical-ref? library-ref?) (only (csc ir2) make-atom make-tail) (scheme base)) (begin (define (to-cps expr continuation) (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) (to-cps program (make-tail)))))