mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-10 07:50:24 +02:00
This commit was manufactured by cvs2svn to create branch
'branch_release-1-6'.
This commit is contained in:
commit
1b3d27e503
1 changed files with 25 additions and 0 deletions
25
ice-9/compile-psyntax.scm
Normal file
25
ice-9/compile-psyntax.scm
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
(use-modules (ice-9 syncase))
|
||||||
|
|
||||||
|
;; XXX - We need to be inside (ice-9 syncase) since psyntax.ss calls
|
||||||
|
;; `eval' int he `interaction-environment' aka the current module and
|
||||||
|
;; it expects to have `andmap' there. The reason for this escapes me
|
||||||
|
;; at the moment.
|
||||||
|
;;
|
||||||
|
(define-module (ice-9 syncase))
|
||||||
|
|
||||||
|
(define source (list-ref (command-line) 1))
|
||||||
|
(define target (list-ref (command-line) 2))
|
||||||
|
|
||||||
|
(let ((in (open-input-file source))
|
||||||
|
(out (open-output-file (string-append target ".tmp"))))
|
||||||
|
(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))
|
Loading…
Add table
Add a link
Reference in a new issue