;; csc -x -X r7rs -R r7rs -uses library -uses eval $@ (module r7csc () (import (only (chicken process-context) command-line-arguments) (only (chicken file) file-exists?) (only (chicken pathname) make-pathname) (only (chicken process) process process-wait) (only (chicken base) exit let*-values) (scheme base) (chicken foreign)) (define r7rs-options '("-x" "-X" "r7rs" "-R" "r7rs" "-uses" "library" "-uses" "eval" "-X" "r7rs-env" "-R" "r7rs-env")) (define (compile) (let*-values ([(csc) (foreign-value "C_CSC_PROGRAM" c-string)] [(path) (foreign-value "C_INSTALL_BIN_HOME" c-string)] [(cscpath) (or (file-exists? (make-pathname path csc)) "csc")] [(in out pid) (process cscpath (append r7rs-options (command-line-arguments)))] [(pid normal-exit? status) (process-wait pid)]) (exit status))) (compile))