Add %auto-compilation-options', used by compile-file' when auto-compiling.
* module/ice-9/boot-9.scm (%auto-compilation-options): New variable. (load-in-vicinity): Honor it. * libguile/load.c (kw_opts, sym_compile_file, sym_auto_compilation_options): New variables. (do_try_auto_compile): Honor %AUTO-COMPILATION-OPTIONS. * module/system/repl/common.scm (repl-default-options): Have `compile-options' default to %AUTO-COMPILATION-OPTIONS.
This commit is contained in:
parent
a4060f6710
commit
5a79300f85
3 changed files with 32 additions and 6 deletions
|
|
@ -3259,6 +3259,10 @@ module '(ice-9 q) '(make-q q-length))}."
|
|||
;;; source location.
|
||||
;;;
|
||||
|
||||
(define %auto-compilation-options
|
||||
;; Default `compile-file' option when auto-compiling.
|
||||
'(#:warnings (unbound-variable arity-mismatch)))
|
||||
|
||||
(define* (load-in-vicinity dir path #:optional reader)
|
||||
;; Returns the .go file corresponding to `name'. Does not search load
|
||||
;; paths, only the fallback path. If the .go file is missing or out of
|
||||
|
|
@ -3303,10 +3307,12 @@ module '(ice-9 q) '(make-q q-length))}."
|
|||
(%load-should-auto-compile
|
||||
(%warn-auto-compilation-enabled)
|
||||
(format (current-error-port) ";;; compiling ~a\n" name)
|
||||
(let ((cfn ((module-ref
|
||||
(let ((cfn
|
||||
((module-ref
|
||||
(resolve-interface '(system base compile))
|
||||
'compile-file)
|
||||
name
|
||||
#:opts %auto-compilation-options
|
||||
#:env (current-module))))
|
||||
(format (current-error-port) ";;; compiled ~a\n" cfn)
|
||||
cfn))
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ See <http://www.gnu.org/licenses/lgpl.html>, for more details.")
|
|||
|
||||
(define repl-default-options
|
||||
(copy-tree
|
||||
`((compile-options (#:warnings (unbound-variable arity-mismatch)) #f)
|
||||
`((compile-options ,%auto-compilation-options #f)
|
||||
(trace #f #f)
|
||||
(interp #f #f)
|
||||
(prompt #f ,(lambda (prompt)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue