* module/statprof.scm: Remove most of the commentary, as it was
duplicated in the manual and was getting out of date.
(stats): Remove self-secs-per-call and cum-secs-per-call fields as
they can be computed from the other fields.
(statprof-call-data->stats): Adapt.
(statprof-stats-self-secs-per-call):
(statprof-stats-cum-secs-per-call): New functions.
(statprof-display/flat): Don't print the seconds-per-call fields, as
we are no longer stopping the clock around call counters. Anyway
these times were quite misleading.
(with-statprof): Deprecate. It took its keyword arguments at the
beginning; very complicated! Better to use the `statprof' function.
(`statprof' was introduced after `with-statprof' and then
`with-statprof' was adapted to use it.)
* doc/ref/statprof.texi (Statprof): Port this documentation away from
the automatically generated text and update it for the new interfaces
like #:display-style.
* module/system/base/syntax.scm (record-case): Remove comment that
referenced with-statprof. Add comment indicating that record-case
should be replaced.
* doc/ref/scheme-using.texi (Profile Commands): Update to mention
keyword arguments and to link to the statprof documentation.
Suggested by Dale P. Smith.
* module/system/base/target.scm (cpu-endianness): Add cases for
"arm.*eb", "^aarch64.*be", and "aarch64". Change "arm" case to
"arm.*".
(triplet-pointer-size): Allow underscore as in 'aarch64_be'.
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["armeb-unknown-linux-gnu",
"aarch64-linux-gnu", "aarch64_be-linux-gnu"]: New tests.
Reported by Sylvain Beucler <beuc@beuc.net>.
* module/system/base/target.scm (cpu-endianness): Add case where CPU is
"arm".
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")["arm-unknown-linux-androideabi"]:
New test.
* module/system/base/compile.scm (compile-file): Pass #:to-disk? as an
option to indicate that the result will be being loaded from disk.
Perhaps a linker might want to page-align in that case.
* module/language/elisp/compile-tree-il.scm (process-options!): Accept
and ignore the #:to-file compiler option.
* module/system/base/target.scm (triplet-pointer-size): Fix typo in the
x32 triplet name.
* test-suite/tests/asm-to-bytecode.test (native-os): New procedure.
(test-target): Use (native-word-size) only when both the CPU and OS
match.
* module/system/base/target.scm (triplet-pointer-size): Add case for
"^x64_64-.*-gnux32".
* test-suite/tests/asm-to-bytecode.test ("cross-compilation"):
["x86_64-unknown-linux-gnux32"]: New test.
* module/system/base/target.scm (cpu-word-size): Rename to...
(triplet-pointer-size): ... this. Update caller. Take a triplet as
the argument. Check the `triplet-os' part when checking for equality
with the host. Add support "mips64.*-gnuabi64".
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")
[ "mips64el-unknown-linux-gnuabi64"]: New test.
* module/system/base/target.scm (cpu-word-size): Consider MIPS64 to
default to n32 or o32.
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")
["mips64el-unknown-linux-gnu"]: New test.
* module/system/base/compile.scm (call-with-output-file/atomic): Call
close-port before deleting the temporary file name, otherwise deletion
fails on MS-Windows (cannot delete a file that is still open).
* module/system/base/language.scm (<language>): Add 'for-humans?'
field, and export new 'language-for-humans?' predicate.
* doc/ref/compiler.texi (Compiler Tower): Document.
* module/language/assembly/spec.scm, module/language/bytecode/spec.scm,
module/language/glil/spec.scm, module/language/objcode/spec.scm,
module/language/tree-il/spec.scm, module/language/value/spec.scm:
Mark these languages as 'for-humans?'.
* module/ice-9/boot-9.scm (current-language): New parameter.
* module/system/base/language.scm (*current-language*): Pull fluid from
parameter.
(current-language): Now a re-exported parameter.
* doc/ref/compiler.texi: Update reference from *current-language* fluid
to current-language parameter.
* module/system/base/compile.scm (compile-and-load):
* module/ice-9/top-repl.scm (top-repl): Default to the current language,
not to Scheme.
* module/ice-9/eval-string.scm:
* module/system/base/language.scm:
* module/system/repl/command.scm:
* module/system/repl/repl.scm: Update to use current-language parameter
and parameterize.
* libguile/vm-i-scheme.c (VM_VALIDATE_STRUCT): Fix the error message if
the value was not a struct.
* module/system/base/compile.scm (find-language-joint): Default to
joining at the target language.
(default-language-joiner): Allow sequences of one compiled expression
to pass through. Otherwise error as before.
(read-and-parse): New helper; actually parses.
(read-and-compile): Use read-and-parse, and fall back to
default-language-joiner.
Thanks to Nala Ginrut for the report.
* module/system/base/compile.scm (read-and-compile): Close the input
port after we read all of its data. Perhaps this cleans up some NFS
ghosts that David Pirotte was seeing.
* module/system/base/ck.scm: New module.
* module/srfi/srfi-9.scm: Import (system base ck).
(getter-type, getter-index, getter-copier): Convert incoming argument
convention to CK form.
(define-tagged-inlinable): Convert return value convention for key
lookup to CK form.
* module/srfi/srfi-9/gnu.scm: Import (system base ck).
Rename '%set-fields-unknown-getter' to 'unknown-getter'.
(c-list, c-same-type-check): New macros.
(%set-fields): Using the CK abstract machine, arrange to check (at
macro expansion time) that all of the getters in head position
correspond to the same record type.
* test-suite/tests/srfi-9.test: Add test.
* module/system/base/compile.scm (ensure-directory): Rename to...
(ensure-directory): ... this. Update callers. When ERRNO is EEXIST,
assume DIR is a writable directory instead of calling `stat' and
`access?' again. Fixes UID/EUID mismatches for setuid binaries.
Reported by rixed@happyleptic.org at
<http://lists.gnu.org/archive/html/guile-user/2012-06/msg00023.html>.
* module/system/base/pmatch.scm (pmatch): Always wrap with 'let', even
if the expression appears atomic, because in the presence of
'identifier-syntax', we cannot know what an atomic expression will
later expand to. Also use '#:export-syntax' instead of '#:export'
to export 'pmatch'.
* module/ice-9/boot-9.scm (cond, case): Reimplement using syntax-case,
with improved error messages and support for '=>' within 'case' as
mandated by the R7RS. Add warnings for duplicate case datums and
case datums that cannot be meaningfully compared using 'eqv?'.
* module/system/base/message.scm (%warning-types): Add 'bad-case-datum'
and 'duplicate-case-datum' warning types.
* test-suite/tests/syntax.test (cond, case): Update tests to reflect
improved error reporting. Add tests for '=>' within 'case'.
* test-suite/tests/tree-il.test (partial evaluation): Update tests to
reflect changes in how 'case' is expanded.
* doc/ref/api-control.texi (Conditionals): Document '=>' within 'case'.
* module/language/tree-il/analyze.scm
(format-analysis)[check-simple-format-args]: New procedure. Use it.
Add support for applications of <module-ref>.
* module/system/base/message.scm (%warning-types): Handle the `format
simple-format' warning.
* module/language/scheme/spec.scm (scheme)[make-default-environment]:
Use `simple-format' as the default `format'.
* test-suite/tests/tree-il.test ("warnings")["format"]: Explicitly use
(@ (ice-9 format) format) where needed.
("simple-format"): New test prefix.
* module/system/base/target.scm (%target-endianness, %target-word-size):
New fluids.
(%native-word-size): New variable.
(with-target): Set these fluids.
(cpu-endianness, cpu-word-size, triplet-cpu, triplet-vendor,
triplet-os): New procedures.
(target-cpu, target-vendor, target-os): Use them.
(target-endianness, target-word-size): Refer to the corresponding
fluid.
* libguile/objcodes.c (target_endianness_var, target_word_size_var): New
global variables.
(NATIVE_ENDIANNESS): New macro.
(target_endianness, target_word_size, to_native_order): New functions.
(make_objcode_from_file): Use `scm_bytecode_to_native_objcode' instead
of `scm_bytecode_to_objcode'.
(bytecode_to_objcode): New function, based on `scm_bytecode_to_objcode',
with the addition of an `endianness' and `word_size' parameters.
(scm_bytecode_to_objcode): Use it.
(scm_bytecode_to_native_objcode): New function.
(scm_write_objcode): Use `target_word_size' and `target_endianness'.
Convert OBJCODE's len and meta-len to native byte order.
(scm_init_objcodes): Initialize `target_endianness_var' and
`target_word_size_var'.
* libguile/objcodes.h (scm_bytecode_to_native_objcode): New declaration.
* libguile/vm.c (really_make_boot_program): Use
`scm_bytecode_to_native_objcode' instead of `scm_bytecode_to_objcode'.
* test-suite/tests/asm-to-bytecode.test (%objcode-cookie-size): New
variable.
(test-target): New procedure.
("cross-compilation"): Add `test-target' calls and the "unknown
target" test.
* module/system/base/target.scm (validate-target): Accept any tuple with
at least 3 parts.
* test-suite/tests/asm-to-bytecode.test (test-triplet): New procedure.
("cross-compilation"): New test prefix.
* libguile/load.c (canonical_to_suffix, scm_primitive_load_path):
* module/ice-9/boot-9.scm (load-in-vicinity):
* module/system/base/compile.scm (compiled-file-name): If the canonical
path of a file is a DOS-style path with a drive letter, turn it into a
path suffix it by removing the colon and prefixing a "/".
Inspired by a patch from Jan Nieuwenhuizen.
* module/system/base/language.scm (current-language): Default to 'scheme
here, rather than relying on *current-language* always being bound.
Thanks to 亚光唐 <texnician@gmail.com> for the report.
* module/Makefile.am:
* module/system/base/target.scm: Add a minimal module to parameterize
the target system type and inspect properties on it like cpu, vendor,
os, endianness, and word size.