1 (use-modules (ice-9 syncase))
3 ;; XXX - We need to be inside (ice-9 syncase) since psyntax.ss calls
4 ;; `eval' int he `interaction-environment' aka the current module and
5 ;; it expects to have `andmap' there. The reason for this escapes me
8 (define-module (ice-9 syncase))
10 (define source (list-ref (command-line) 1))
11 (define target (list-ref (command-line) 2))
13 (let ((in (open-input-file source))
14 (out (open-output-file (string-append target ".tmp"))))
15 (with-fluids ((expansion-eval-closure
16 (module-eval-closure (current-module))))
17 (let loop ((x (read in)))
23 (write (sc-expand3 x 'c '(compile load eval)) out)
27 (system (format #f "mv -f ~s.tmp ~s" target target))