(module r7csi () (import (only (chicken process-context) get-environment-variable command-line-arguments) (only (chicken process) process-execute) (only (chicken base) exit) (only (chicken pathname) make-pathname) (only (chicken file) file-exists?) (scheme base) (chicken foreign)) (define r7rs-options (append '("-R" "r7rs-env"))) (define (interpret) (let*-values ([(csi) (foreign-value "C_CSI_PROGRAM" c-string)] [(path) (foreign-value "C_INSTALL_BIN_HOME" c-string)] [(csipath) (or (file-exists? (make-pathname path csi)) "csi")]) (process-execute csipath (append r7rs-options (command-line-arguments))))) (interpret))