On Windows, deleting a file on an open port does not succeed
* test-suite/tests/ports.test ("%default-port-encoding, wrong encoding"):
ensure port is closed before deleting
* configure.ac (AC_CHECK_FUNCS): add mkdtemp! test
* doc/ref/posix.texi: document mkdtemp!
* libguile/filesys.c (scm_mkdtemp_x): new function
* libguile/filesys.h: new declaration for scm_mkdtemp_x
* test-suite/tests/filesys.test: add tests for mkdtemp!
Adapted from a patch by Rob Browning.
* libguile/r6rs-ports.c (scm_i_make_transcoded_ports): make sure to
include SCM_RDNG for input/output ports.
Thanks to Göran Weinholt for reporting the problem.
Closes: 41045
* module/scheme/base.scm (member): Match the r7rs requirement, as assoc
already does.
Thanks to Erik Dominikus for reporting the problem.
Closes: 43304
* module/ice-9/boot-9.scm (%auto-compilation-options): Add
use-before-definition and non-idempotent-definition.
* module/language/tree-il/analyze.scm (<use-before-def-info>): New
analysis info.
(make-use-before-definition-analysis): New function.
(goops-toplevel-definition): Move down.
(unbound-variable-analysis, macro-use-before-definition): Remove, as
they are subsumed by use-before-def. There are some deprecated
bindings though.
(make-analyzer): Rework to allow for use-before-def analysis to handle
multiple
* module/system/base/message.scm (%warning-types): Add handlers for the
new warning types.
* test-suite/tests/tree-il.test: Add tests.
* doc/ref/api-evaluation.texi (Compilation): Update.
Reported by Jérémy Korwin-Zmijowski
(https://lists.gnu.org/archive/html/bug-guile/2020-08/msg00010.html).
Fix from
7cf4c01039:
Apply fix from Per Bothner.
In Per's words:
* testing.scm (%test-end): Reset test-runner-current if done.
This fixes bug "Loading test source file multiple time without having
report incrementing" reported to srfi-64 mailing list.
* srfi-64-test.scm: Update due to recent srfi-64 implementation change.
* module/ice-9/popen.scm (open-process)[unbuffered, fdes-pair]: New
procedures.
Use them. Return unbuffered ports.
* test-suite/tests/popen.test ("open-pipe*"): New test prefix.
Fixes <https://bugs.gnu.org/40582>.
Reported by Julien Lepiller <julien@lepiller.eu>.
Previously, a host part consisting of hex digits would be mistaken as an
IPv6 address and rejected by 'valid-host?'.
* module/web/uri.scm (ipv6-regexp): Add colon.
* test-suite/tests/web-uri.test ("string->uri")["xyz://abc/x/y/z"]: New
test.
* NEWS: Update.
* libguile/read.c (scm_read_string_like_syntax): All characters are
permitted by law; some aren't valid in certain contexts.
* test-suite/tests/reader.test: Replace occurrences of "illegal" by
"invalid".
* test-suite/tests/strings.test: Likewise.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* module/language/tree-il/primitives.scm (expand-eq): Just expand out to
binary comparisons. Also expand eq?, which was missing. Leave
strength reduction to peval.
(character-comparison-expander): Move down, as it depends on <, <=,
and so on.
* module/language/tree-il/peval.scm (peval): Robustly reduce equal? and
eqv?.
* test-suite/tests/peval.test ("partial evaluation"): Expect fixnum
comparison to reduce to eq?.
("eqv?", "equal?"): A new battery of tests.
* test-suite/tests/tree-il.test ("primitives"): Remove reduction tests.
Fixes <https://bugs.gnu.org/41204>.
Reported by Caleb Ristvedt <caleb.ristvedt@cune.org>.
Until now, Guile would leak the file descriptors of all the file ports
not explicitly closed.
* libguile/fports.c (scm_i_fdes_to_port): Initialize fp->revealed.
* test-suite/tests/ports.test ("initial revealed count")
("non-revealed port is closed"): New tests.
("close-port & revealed port"): Check (port-revealed port).
("revealed port fdes not closed"): Likewise.
* module/language/tree-il/analyze.scm (make-analyzer): Expect an int for
optimization level.
* module/scripts/compile.scm (%options, show-warning-help): No more
-Wnone / Wall; use -W0 or -W9 instead.
* module/system/base/compile.scm (level-validator): Validate small int.
(compute-analyzer, add-default-optimizations): Likewise.
* test-suite/tests/optargs.test (without-compiler-warnings):
* test-suite/tests/tree-il.test (call-with-warnings): Parameterize level
to 0, not #f.
* bootstrap/Makefile.am (GUILE_WARNINGS): Use -W0, not -Wnone.
* module/system/base/compile.scm (compute-analyzer): Compute analyzer to
run on expressions before the compiler runs.
(add-default-optimizations): Flesh out; still a stub.a
(read-and-compile, compile, compile-and-load, compile-file): Default
warning and optimization levels.
(default-warning-level): New parameter, defaulting to 1.
(default-optimization-level): New parameter, defaulting to 2.
Currently unused.
* module/system/base/language.scm (<language>): Add
optimizations-for-level and analyzer fields.
* module/language/tree-il/compile-bytecode.scm (compile-bytecode):
* module/language/tree-il/compile-cps.scm (optimize-tree-il): No need to
run warnings passes here; compilers infrastructure will run them.
* module/language/tree-il/spec.scm (tree-il): Define make-analyzer as
analyzer.
* module/language/tree-il/analyze.scm (make-analyzer): New exported
procedure.
(%warning-passes): New private variable.
* .dir-locals.el: Add with-test-prefix/c&e indent mode.
* test-suite/tests/cross-compilation.test:
* test-suite/tests/optargs.test:
* test-suite/tests/tree-il.test: Adjust to disable default warnings.
* module/language/tree-il/primitives.scm (call-with-prompt): Only pass
"values handlers" as handler: lambdas with only req and rest args, and
only one clause.
* module/language/tree-il/compile-cps.scm (canonicalize): Remove
eta-conversion pass here.
* test-suite/tests/peval.test ("partial evaluation"): Adapt test.
This is an opportunity to make a new interface that can be more
efficient in 3.0 (because no generic array support), easier to read (no
need for 'not'), and more consistent with other bitvector interfaces.
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/array-handle.h (bitvector_ref, scm_array_get_handle): Adapt
to bitvector changes.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_c_bitvector_bit_is_set)
(scm_c_bitvector_bit_is_clear): New functions.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bitvector_ref): Deprecate.
* module/ice-9/sandbox.scm (bitvector-bindings): Replace
bitvector-ref with bitvector-bit-set? / bitvector-bit-clear?.
* module/system/vm/disassembler.scm (instruction-has-fallthrough): Use
bitvector-bit-clear?.
* test-suite/tests/bitvectors.test: Update.
The old name was wonky and hard to read: you almost always pass a
literal as the value to set, so better to make separate functions.
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_bitvector_set_bits_x)
(scm_bitvector_clear_bits_x): New functions.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bit_set_star_x): Deprecate.
* module/ice-9/sandbox.scm (mutable-bitvector-bindings): Replace
bit-set*! with bitvector-set-bits! / bitvector-clear-bits!.
* module/system/vm/frame.scm (available-bindings, compute-killv): Use
bitvector-set-bits! and bitvector-clear-bits!.
* test-suite/tests/bitvectors.test: Update.
The old name was wonky and had bad argument order.
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_bitvector_position): New function.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bit_position): Deprecate.
* module/ice-9/sandbox.scm (bitvector-bindings): Replace bit-position
with bitvector-position.
* module/language/cps/intset.scm (bitvector->intset): Use
bitvector-position.
* module/system/vm/frame.scm (available-bindings): Use
bitvector-position.
* test-suite/tests/bitvectors.test ("bitvector-position"): Add test.
The old name was wonky and had bad argument order.
* NEWS: Add entry.
* doc/ref/api-data.texi (Bit Vectors): Update.
* libguile/bitvectors.h:
* libguile/bitvectors.c (VALIDATE_BITVECTOR): New helper.
(scm_bitvector_count): New function.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_bit_count): Deprecate.
* module/ice-9/sandbox.scm (bitvector-bindings): Replace bit-count with
bitvector-count.
* module/srfi/srfi-60.scm: No need to #:replace bit-count.
* module/system/vm/frame.scm (available-bindings): Use bitvector-count.
* test-suite/tests/bitvectors.test ("bitvector-count"): Add test.
* NEWS: Update.
* doc/ref/api-data.texi (Bit Vectors): Update documentation on bit-set*!
and bit-count*.
* libguile/bitvectors.c: Add a to-do list.
(scm_c_bitvector_ref, scm_c_bitvector_set_x, scm_bitvector_fill_x)
(scm_bitvector_to_list, scm_bit_count, scm_bit_position):
Issue deprecation warnings when used on array slices.
(scm_list_to_bitvector): Simplify.
(scm_bit_set_star_x, scm_bit_count_star): Deprecate arrays as target
bitvectors, and also use of u32vector as selection vector.
* libguile/bitvectors.h:
* libguile/deprecated.h:
* libguile/deprecated.c (scm_istr2bve): Deprecate.
* test-suite/tests/bitvectors.test ("bit-count*"): Remove test of u32
selectors.
This adds SRFI-171 (transducers) to guile.
The two guile-specific additions are powerful transducers which can be
used to generalize transducers like tsegment. They are hard to get
right, but powerful and useful enough to warrant inclusion.
* doc/ref/srfi-modules.texi: added srfi-171 section
* module/Makefile.am (SOURCES):
* module/srfi/srfi-171.scm:
* module/srfi/srfi-171/meta.scm: Add SRFI-171
* module/srfi/srfi-171/gnu.scm: Add 2 guile-specific extensions.
* test-suite/Makefile.am (SCM_TESTS):
* test-suite/tests/srfi-171.test: Add tests.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This is a followup to ddcab06f20. Until
now the tests would always be marked as unresolved because TMPDIR was
removed before the client and server had been started.
* test-suite/tests/00-repl-server.test (call-with-repl-server): Remove
initial call to 'rmdir'. Add calls to 'delete-file' and 'rmdir' in the
unwind handler.
Fixes <https://bugs.gnu.org/39509>.
Reported by Klaus Stehle <klaus.stehle@uni-tuebingen.de>.
* module/language/tree-il/primitives.scm (error): Remove extra "?"
argument when the first argument is not a constant.
* test-suite/tests/tree-il.test ("primitives")["error"]: New test
prefix.
Fixes <https://bugs.gnu.org/37846>.
Reported by Christopher Baines <mail@cbaines.net>.
* module/texinfo/plain-text.scm (acronym): New procedure.
(tag-handlers): Change 'acro' handle to ACRONYM, and add 'acronym'
handler.
* test-suite/tests/texinfo.plain-text.test ("stexi->plain-text")
["acronym", "recursive acronym"]: New tests.
* module/texinfo/plain-text.scm (*line-width*): New variable.
(wrap*): Honor it.
* doc/ref/texinfo.texi (texinfo plain-text): Document it.
* test-suite/tests/texinfo.plain-text.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add it.
The current implementation of srfi-11s let-values allows later clauses
to access and modify variables bound in earlier clauses when the clause
is not a proper list.
* module/srfi/srfi-11.scm (let-values): Fix switched variable names.
* test-suite/tests/srfi-11.test (let-values): Add test checking that the
variable cannot be changed in later clauses.
Previously (fluid-ref (make-thread-local-fluid #t)) would return #f via
scm_fluid_ref because the internal scm_hashq_ref would return #f when
the fluid had not been set, and that was interpreted as an actual value
for the fluid.
Instead, just pass the fluid default as the default for the hash table
lookups so that we don't need a second step to determine if the fluid
was set.
Thanks to Andrew Gierth for tracking down the problem.
* module/language/tree-il/peval.scm (peval): Fix arity check for type
confusion (empty value of "rest" in this context was (), not #f). The
effect was that we'd silently allow extra arguments to inlined calls.
Thanks to Christopher Lam for the report! Fixes#38617.
* test-suite/tests/peval.test ("partial evaluation"): Add a test.