Hi All,

Guile bug report 30094 is a wishlist request for adding support for alterantive 
languages.
To that bug report I attached proposed code for allowing -from being generated 
from
(1) #lang <lang> or (2) file extension.

The essential change is to compile-file in (system base compile):

        (ensure-directory (dirname comp))
        (call-with-output-file/atomic comp
!         (lambda (port)
!           ((language-printer (ensure-language to))
!            (read-and-compile in #:env env #:from from #:to to #:opts
!                              (cons* #:to-file? #t opts))
!            port))
!         file)
!       comp)))
--- 16,31 ----
        (ensure-directory (dirname comp))
        (call-with-output-file/atomic comp
!       (lambda (port)
!         (let* ((from (or from
!                          (lang-from-port in)
!                          (lang-from-file file)
!                          (current-language)))
!                (env (or env (default-environment from))))
!           (simple-format (current-error-port) "compiling from lang ~A\n" from)
!           ((language-printer (ensure-language to))
!            (read-and-compile in #:env env #:from from #:to to #:opts
!                              (cons* #:to-file? #t opts))
!            port)))
!         file)
!       comp)))

Matt


Reply via email to