Commit | Line | Data |
---|---|---|
9c35c579 AW |
1 | (let ((source (list-ref (command-line) 1)) |
2 | (target (list-ref (command-line) 2))) | |
3 | (let ((in (open-input-file source)) | |
4 | (out (open-output-file (string-append target ".tmp")))) | |
5 | (write '(eval-when (compile) (set-current-module (resolve-module '(guile)))) | |
6 | out) | |
7 | (newline out) | |
8 | (let loop ((x (read in))) | |
9 | (if (eof-object? x) | |
10 | (begin | |
11 | (close-port out) | |
12 | (close-port in)) | |
13 | (begin | |
14 | (write (sc-expand3 x 'c '(compile load eval)) | |
15 | out) | |
16 | (newline out) | |
17 | (loop (read in)))))) | |
18 | (system (format #f "mv -f ~s.tmp ~s" target target))) |