summaryrefslogtreecommitdiff
path: root/libguile/load.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-08-18 11:05:17 +0200
committerAndy Wingo <wingo@pobox.com>2009-08-18 11:06:04 +0200
commit9591a2b016c5c11d2cd92ff0d43cd511f28bc07f (patch)
tree794c6a9ce84a46dae074dc0f1e9f676b756e0455 /libguile/load.c
parente33a910dd0f430f34c32fe6846899aee33fc2cf6 (diff)
downloadguile-9591a2b016c5c11d2cd92ff0d43cd511f28bc07f.tar.gz
`load' autocompiles
* libguile/load.h: * libguile/load.c (scm_sys_warn_autocompilation_enabled): New primitive, not exported. Since `load' autocompiles now, it should warn in the same way that the bits hardcoded into C warn. (scm_try_autocompile): Use scm_sys_warn_autocompilation_enabled. * module/ice-9/boot-9.scm (autocompiled-file-name): New helper. (load): Try autocompiling the argument, if appropriate. Will autocompile files passed on Guile's command line. `primitive-load' is unaffected.
Diffstat (limited to 'libguile/load.c')
-rw-r--r--libguile/load.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/libguile/load.c b/libguile/load.c
index 08324c587..8a6fadb33 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -639,14 +639,11 @@ autocompile_catch_handler (void *data, SCM tag, SCM throw_args)
return SCM_BOOL_F;
}
-static SCM
-scm_try_autocompile (SCM source)
+SCM_DEFINE (scm_sys_warn_autocompilation_enabled, "%warn-autocompilation-enabled", 0, 0, 0,
+ (void), "")
{
static int message_shown = 0;
- if (scm_is_false (*scm_loc_load_should_autocompile))
- return SCM_BOOL_F;
-
if (!message_shown)
{
scm_puts (";;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0\n"
@@ -655,6 +652,17 @@ scm_try_autocompile (SCM source)
message_shown = 1;
}
+ return SCM_UNSPECIFIED;
+}
+
+
+static SCM
+scm_try_autocompile (SCM source)
+{
+ if (scm_is_false (*scm_loc_load_should_autocompile))
+ return SCM_BOOL_F;
+
+ scm_sys_warn_autocompilation_enabled ();
return scm_c_catch (SCM_BOOL_T,
do_try_autocompile,
SCM2PTR (source),