(use gauche.regexp) (define (escape str) (set! str (regexp-replace-all #/&/ str "&")) (set! str (regexp-replace-all #// str ">")) str) (define (read-file-and-escape file) (call-with-input-file file (lambda (in) (escape (port->string in))))) (define (main args) (call-with-input-file (cadr args) (lambda (in) (let* ((content (port->string in)) (content (regexp-replace-all #/#\{(.*?)\}/ content (lambda (m) (string-append "
\n"
                                             (read-file-and-escape (rxmatch-substring m 1))
                                             "
\n"))))) (display content)))) 0)