make primitive-load-path load compiled files if available
authorAndy Wingo <wingo@pobox.com>
Tue, 2 Sep 2008 07:08:26 +0000 (00:08 -0700)
committerAndy Wingo <wingo@pobox.com>
Tue, 2 Sep 2008 18:00:32 +0000 (11:00 -0700)
commit22f4ee48822db5e30df3abf9a11b6066f2bab9d3
tree90124ad07e17cf1a0d08ebf46374b161ac5ad3b9
parent90b0be2028677095d6a1879c6461008ed00ea119
make primitive-load-path load compiled files if available

* libguile/load.h: Update scm_search_path prototype.

* libguile/load.c: Include vm.h for load-compiled/vm. Not sure if this is
  bad wrt modularity.
  (scm_c_string_has_an_ext): New private helper.
  (scm_search_path): Add an extra optional arg, `require_exts'; if true,
  require that the returned file name have one of the given extensions.
  Changes the C API, but not the scheme API.
  (scm_sys_search_load_path): Adapt to scm_search_path API change.
  (primitive-load-path): Here is the craziness: load a compiled file if
  found and newer than the corresponding (or not) source file.
  (scm_init_load): Define %load-compiled-extensions as the list of
  extensions denoting compiled files; defaults to '(".go").
libguile/load.c
libguile/load.h
libguile/vm.h