(define-library (csc ir2) (export apply-arguments apply-procedure apply? atom-continuation atom-expression atom? branch-atom branch-false branch-true branch? call-closure-args call-closure-closure call-closure? closure-arguments closure-body closure-name closure-rest closure? fix-body fix-functions fix? ir2=? kargs-expression kargs-refs kargs? klabel-expression klabel? ktail? make-apply make-atom make-branch make-call-closure make-closure make-fix make-kargs make-klabel make-ktail make-update update-atom update-continuation update-ref ; Re-exports from IR1. constant-expression constant? lexical-ref-gensym lexical-ref-name lexical-ref? library-ref-library library-ref-name library-ref? make-constant make-lexical-ref lexical-set-expression lexical-set-ref lexical-set? make-lexical-set make-library-ref) (import (scheme base) (only (csc ir1) constant? ir1=? lexical-ref-gensym lexical-ref-name lexical-ref? lexical-set-expression lexical-set-ref lexical-set? library-ref-library library-ref-name library-ref? make-constant make-lexical-ref make-lexical-set make-library-ref) (only (csc list) all) (only (csc loop) loop return) (only (csc match) define-match-record-type)) (begin ; This library defines the intermediate representation IR2. ; It's CPS time bitch. ; CPS atom: ; An atom is a value that can be computed immediately without ; any subexpressions. ; Atoms consist of ; - constant, ; - lexical-ref, ; - or library-ref ; After closure conversion, lexical refs are no longer allowed. ; Lexical refs are converted to one of the below data types. ; A variable representing the address of a function in the same compilation ; unit. This will be a constant after linking. (define-match-record-type