As the FSF advises, 'There is no legal significance to using the
three-character sequence “(C)”, but it does no harm.' It does take up
space though! For that reason, we remove it here from our C files.
* libguile/load.c (scm_i_mirror_backslashes): New function.
(scm_init_load_path): Call it to produce MS-Windows file names
with forward slashes.
(FILE_NAME_SEPARATOR_STRING): Define as "/" on all platforms.
* libguile/load.h (scm_i_mirror_backslashes): Add prototype.
* libguile/init.c (scm_boot_guile): Call scm_i_mirror_backslashes
on argv[0].
* libguile/filesys.c (scm_getcwd): Call scm_i_mirror_backslashes
on the directory name returned by getcwd.
* test-suite/tests/ports.test ("file name separators"): New test.
* libguile/load.c (scm_ellipsis): New Variable.
(scm_parse_path_with_ellipsis): New procedure.
(scm_init_load): Initialize 'scm_ellipsis'.
(scm_init_load_path): Use 'scm_parse_path_with_ellipsis' to
handle GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH.
* libguile/load.h (scm_parse_path_with_ellipsis): Add prototype.
* doc/ref/guile-invoke.texi (Environment Variables):
doc/ref/api-evaluation.texi (Load Paths): Add documentation.
Correct description of default load path to reflect reality.
Remove 'GUILE_LOAD_PATH' from the concept index; it is already
in the variable index. Add cross references between these two
sections of the manual.
* libguile/load.h:
* libguile/load.c (scm_sys_global_site_dir): New API, is what %site-dir
used to be.
(scm_sys_site_dir): Changed to be a version-specific dir.
(scm_init_load_path): Search the version-specific sitedir before the
global one.
* libguile/Makefile.am (libpath.h): Update SCM_SITE_DIR and
SCM_GLOBAL_SITE_DIR, as appropriate.
* libguile/load.c (scm_init_load): Initialize %load-should-autocompile
to false.
* libguile/init.c (scm_i_init_guile):
* libguile/load.h:
* libguile/load.c (scm_init_load_should_autocompile): At the end of
init, check GUILE_AUTO_COMPILE.
* libguile/script.c (scm_compile_shell_switches): Instead of making
--autocompile / --no-autocompile render into the s-expression, just
handle them immediately, so that --no-autocompile takes effect for the
expander.
* libguile/eval.c (scm_primitive_eval, scm_c_primitive_eval):
(scm_init_eval): Rework so that scm_primitive_eval always calls out to
the primitive-eval variable. The previous definition is the default
value, which is probably overridden by scm_init_eval_in_scheme.
* libguile/init.c (scm_i_init_guile): Move ports and load-path up, so we
can debug when initing eval. Call scm_init_eval_in_scheme. Awesome.
* libguile/load.h:
* libguile/load.c (scm_init_eval_in_scheme): New procedure, loads up
ice-9/eval.scm to replace the primitive-eval definition, if everything
is there and up-to-date.
* libguile/modules.c (scm_module_transformer): Export to Scheme, so it's
there for eval.go.
* module/ice-9/boot-9.scm: No need to define module-transformer.
* module/ice-9/eval.scm (capture-env): Only reference the-root-module if
modules are booted.
(primitive-eval): Inline a definition for identity. Throw a more
standard error for "wrong number of arguments".
* module/ice-9/psyntax.scm (chi-install-global): The macro binding for a
syncase macro is now a pair: the transformer, and the module that was
current when the transformer was installed. The latter is used for
hygiene purposes, replacing the use of procedure-module, which didn't
work with the interpreter's shared-code closures.
(chi-macro): Adapt for the binding being a pair, and get the hygiene
from the cdr.
(eval-local-transformer): Adapt to new form of macro bindings.
* module/ice-9/psyntax-pp.scm: Regenerated.
* .gitignore: Ignore eval.go.stamp.
* module/Makefile.am: Reorder for fastest serial compilation, now that
there are no ordering constraints. I did a number of experiments here
and this seems to be the best; but the bulk of the time is compiling
psyntax-pp.scm with eval.scm. Not so great.
* libguile/vm-engine.c (vm-engine): Throw a more standard error for
"wrong type to apply".
* test-suite/tests/gc.test ("gc"): Remove a hack that shouldn't affect
the new evaluator, and throw in another (gc) for good measure.
* test-suite/tests/goops.test ("defining classes"):
* test-suite/tests/hooks.test (proc1): We can't currently check what the
arity is of a closure made by eval.scm -- or more accurately all
closures have 0 required args and no rest args. So punt for now.
* test-suite/tests/syntax.test ("letrec"): The scheme evaluator can't
check that a variable is unbound, currently; perhaps the full "fixing
letrec" expansion could fix this. But barring that, punt.
The incompatibility was introduced by
0fb81f95b0 ("add exception_on_error
optional arg to primitive-load-path").
* libguile/load.c (scm_primitive_load_path): Change to take 1 rest
argument. Interpret the argument as either a file name (C-level
backward compatibility with 1.8) or an actual argument list.
(scm_c_primitive_load_path): Update caller.
* libguile/load.h (scm_primitive_load_path): Update accordingly.
* doc/ref/api-evaluation.texi (Loading): Update documentation of
`primitive-load-path' and `scm_primitive_load_path ()'.
* 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.
* libguile/init.c (scm_load_startup_files): Use
scm_c_primitive_load_path.
* libguile/load.c (scm_primitive_load_path): Add an optional arg,
exception_on_error, which if #f will cause primitive-load-path to just
return #f if no file is found. This is to help out the semantics of
try-module-autoload. We can't just catch misc-error, because loading
the file could raise any exception.
(scm_c_primitive_load_path): Add the extra arg to
scm_primitive_load_path.
* libguile/load.h: Adapt scm_primitive_load_path prototype.
* module/ice-9/boot-9.scm (try-module-autoload): Refactor slightly to be
clearer.
* 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").
(scm_parse_path): Use scm_string_split to do the work.
(scm_init_load_path): Use scm_parse_path instead of
scm_internal_parse_path.
(scm_search_path): Rewritten string handling part of the code in
terms of scm_to_locale_stringbuf and so that it is thread safe.
added append docs from R4RS.
* strings.c: Docstring typo fix, + eliminate unneeded IMP tests.
Thanks Dirk Hermann!
* chars.h: Provide SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR and
deprecate SCM_ICHRP, SCM_ICHR, SCM_MAKICHR. Thanks Dirk Hermann!
* *.h, *.c: Use SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR throughout.
Drop use of SCM_P for function prototypes... assume an ANSI C
compiler. Thanks Dirk Hermann!
set_print_params_x.
* guile-doc-snarf.in: Use guile-snarf.awk, not
guile-doc-snarf.awk. Pass the basename of $filename
* load.h: Added prototypes for scm_sys_library_dir,
scm_sys_site_dir.
* load.c (scm_sys_library_dir, scm_sys_site_dir): Added these
functions, and took out the old scm_library_dir, scm_site_dir,
scm_pkgdata_dir. Now the primitives are %package-data-dir
(already existed), %library-dir, and %site-dir.
* debug.c: Use SCM_MISC_ERROR when possible instead of using
s_scm_* in a scm_misc_error() call.
* Makefile.am: Use guile-snarf.awk, not guile-doc-snarf.awk. Make
using guile-doc-snarf send stdout to $@ to create the .x file like
guile-snarf does.
* guile-snarf.awk.in: Added.
* gdbint.c (gdb_read): update scm_lreadr usage.
* load.h: update prototypes.
* load.c (scm_primitive_load, scm_read_and_eval_x,
scm_primitive_load_path): remove case_insensitive_p, sharp arguments.
* read.h: add prototype for scm_read_hash_extend. Change args for
other prototypes.
* read.c (scm_read_hash_procedures): new variable.
(scm_read_hash_extend): new procedure.
(scm_get_hash_procedure): new procedure.
* (scm_lreadr): use scm_get_hash_procedure instead of an argument
for extended # processing.
(scm_read, scm_lreadr, scm_lreadrecparen, scm_lreadparen,
scm_read_token): remove case_i, sharp arguments. Change callers.
* read.h (SCM_N_READ_OPTIONS): increase to 3.
(SCM_CASE_INSENSITIVE_P): define.
* read.c: add case-insensitive option to scm_read_opts.
* (scm_read_token): use SCM_CASE_INSENSITIVE_P instead of an argument
to determine whether to convert symbol case.
(default_case_i): definition removed.
* read.c (scm_read_token): if case_i, downcase ic before doing
anything with it.
from scm_sys_try_load and scm_sys_try_load_path. The Scheme name
of scm_primitive_load_path was also changed to
"primitive-load-path", from "%try-load-path". Callers changed.
We'd like to respect the convention that a function named
"try-mumble" should behave just like the function called "mumble",
but return #f instead of signalling some error.
* load.h: Rename prototypes.
code, so we can use the load-path to find the ice-9 boot code;
this makes it easier to run Guile without installing it. See
corresponding changes in guile/Makefile.in.
* feature.c: Move stuff concerned with the load path to load.c.
(scm_compiled_library_path): Deleted.
Don't #include libpath.h here.
* feature.h: Don't mention scm_compiled_library_path.
* load.c: #include "libpath.h" here, as well as <sys/types.h>,
<sys/stat.h>, and <unistd.h> (if present).
(R_OK): #define if the system hasn't deigned to.
(scm_loc_load_path): New variable.
(scm_init_load_path, scm_sys_search_load_path,
scm_sys_try_load_path): New functions.
(scm_init_load): Initialize scm_loc_load_path to point to the
value cell of the Scheme %load-path variable.
* load.h: Add declarations for scm_sys_search_load_path,
scm_sys_try_load_path.
* init.c: Call scm_init_load_path.
* Makefile.in (feature.o, load.o): Dependencies updated.
* load.c, load.h: Rewrite using PROTO macro.