mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-05 11:40:20 +02:00
* libguile/eval.h: * libguile/eval.c (scm_m_eval_when): Define a cheap eval-when, used before syncase has booted. * module/Makefile.am: Reorder to put (system vm) and (system repl) modules after the compiler, as they are not needed at runtime. * module/ice-9/boot-9.scm: Move the eval-when earlier, to be the first thing -- so when we recompile Guile we do so all in the '(guile) module, not '(guile-user). * module/ice-9/compile-psyntax.scm: Rewrite to assume that psyntax.scm will eval-when to set its module, etc. Have everything in a let -- otherwise the `format' call is in (guile), but `target' was defined in (guile-user). Also, write in an eval-when to the expanded file. * module/ice-9/psyntax-pp.scm: Regenerate. * module/ice-9/networking.scm: * module/ice-9/psyntax.scm: * module/ice-9/r4rs.scm: Sprinkles of eval-when, for flavor.
18 lines
649 B
Scheme
18 lines
649 B
Scheme
(let ((source (list-ref (command-line) 1))
|
|
(target (list-ref (command-line) 2)))
|
|
(let ((in (open-input-file source))
|
|
(out (open-output-file (string-append target ".tmp"))))
|
|
(write '(eval-when (compile) (set-current-module (resolve-module '(guile))))
|
|
out)
|
|
(newline out)
|
|
(let loop ((x (read in)))
|
|
(if (eof-object? x)
|
|
(begin
|
|
(close-port out)
|
|
(close-port in))
|
|
(begin
|
|
(write (sc-expand3 x 'c '(compile load eval))
|
|
out)
|
|
(newline out)
|
|
(loop (read in))))))
|
|
(system (format #f "mv -f ~s.tmp ~s" target target)))
|