* module/language/cps/specialize-numbers.scm (sigbits-ref): New helper.
(invert-graph*): New helper.
(compute-significant-bits): When visiting a term changes computed
needed-bits for one of its definitions, we need to revisit the variables
that contributed to its result (the uses), because they might need more
bits as well. Previously we were doing this by enqueueing predecessors
to the term, which worked if the uses were defined in predecessors, or
if all defining terms were already in the worklist, which is the case
without loops. But with loops, when revisiting a term, you could see
that it causes sigbits to change, enqueue its predecessors, but then the
predecessors don't change anything and the fixpoint stops before
reaching the definitions of the variables we need. So instead we
compute the use-def graph and enqueue defs directly.
* module/language/cps/specialize-numbers.scm (next-power-of-two): Use
integer-length. No change.
(compute-significant-bits): Fix the fixpoint computation, which was
failing to complete in some cases with loops.
* module/language/cps/specialize-numbers.scm (specialize-operations):
Accept any operand to logand/immediate, provided the result is a u64 in
the right range.
* module/language/cps/types.scm
(ulogand, ulogand/immediate, ulogsub, ulogior, ulogxor): Where we have
u64 inputs, there's no need to `restrict!`; the range will come from the
definition.
* module/language/tree-il/peval.scm (peval)
(inlinable-kwargs-bug-fixup): Before 3.0.10, the inlinable exports pass
was incorrectly serializing functions with keyword arguments. This was
fixed in 2c645571b3, but that meant that
3.0.10 compiling against 3.0.9 binaries could raise an exception at
compile-time; whoops. Add a workaround so that 3.0.9 binaries still
work.
Fixes https://issues.guix.gnu.org/72936.
* module/ice-9/psyntax.scm: Use the newer LGPLv3 header. Add FSF
copyright lines for each year the file was modified. Remove inline
changelogs. Remove some comments describing psyntax in other Scheme
implementations.
* module/language/cps/intset.scm (make-intset-folder): intset-fold-right
on a transient intset would dispatch to left fold after making the
persistent set. Sadness!
...now that all of the C code has been migrated to Scheme.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
remove srfi-1.c.
(DOC_X_FILES): Remove srfi-1.x.
(DOT_DOC_FILES): Remove srfi-1.doc.
(modinclude_HEADERS): Remove srfi-1.h.
* libguile/init.c (scm_i_init_guile): Don't call scm_register_srfi_1.
* libguile/srfi-1.c: Remove.
* libguile/srfi-1.h: Remove.
* module/srfi/srfi-1.scm: Don't load srfi-1 from libguile.
The Scheme implementation is an adapted version of the approach used by
delete-duplicates, which allows sharing any common tail.
* libguile/srfi-1.c (scm_srfi1_remove): delete.
* libguile/srfi-1.h (scm_srfi1_remove): delete.
* module/srfi/srfi-1.scm: add remove.
* check-guile.in (top_srcdir): Don't try to make guile-procedures.tx, as
this races with multiple checkers, and it's gross.
* meta/uninstalled-env.in (GUILE_DOCSTRINGS_PATH): Instead when
uninstalled, use this variable.
* module/ice-9/documentation.scm (documentation-files): Remove the
current directory from the search path for documentation files; this was
always a hack. Instead allow GUILE_DOCSTRINGS_PATH to override the
built-in search path.
* libguile/r6rs-ports.c (get_bytevector_all_var): New variable.
(init_bytevector_io_vars): New function.
(scm_get_bytevector_all): Rewrite as a proxy to ‘get-bytevector-all’
from (ice-9 binary-port).
* module/ice-9/binary-ports.scm (get-bytevector-all): New procedure.
* NEWS: Update.
Reported-by: Christopher Baines <mail@cbaines.net>
As suggested in
<https://lists.gnu.org/archive/html/guile-devel/2023-06/msg00008.html>.
* module/language/wisp.scm (wisp-uuid): Remove.
(repr-quote, repr-unquote, repr-quasiquote, repr-unquote-splicing)
(repr-syntax, repr-unsyntax, repr-quasisyntax, repr-unsyntax-splicing):
Turn into uninterned symbols.
(line-continues?, chunk-ends-with-period,
line-code-replace-inline-colons): Adjust comparisons accordingly.
(wisp-replace-paren-quotation-repr)[pred]: New procedure.
Use it to compare against the various ‘repr-’ values.
(wisp-make-improper)[dot?]: New procedure.
Use it to compare against ‘repr-dot’.
The builtin primitive procedure `error` takes an optional message and
a list of arguments to include into the error message.
These args are formatted with `~S` and appended to the error message, so
that an example call of
`(error "Wrong argument: " 42)`
results in the output
"Wrong argument: 42"
If format strings occur in the message itself, however, they are
escaped. Thus a call like
`(error "Wrong argument: ~a" 42)`
is rendered as
"Wrong argument: ~a 42"
Some callers did not take this behavior into account, leading to
confusing error messages.
Changing the behavior of `error` to be
both backwards-compatible and accept also format strings inside messages
is not straightforward, because it would have to handle escaped `~`
characters as well. Therefore, fix `error` call sites using format
strings to use `format` before calling out to `error`.
The following files are affected:
* module/ice-9/format.scm (format)
* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface)
* module/oop/goops.scm (make)
* module/srfi/srfi-37.scm (Comment at the beginning of file)
* module/system/base/compile.scm (call-once)
* module/system/repl/command.scm (break, tracepoint)
* module/system/repl/common.scm (repl-default-options)
* module/system/vm/traps.scm (arg-check, trap-at-source-location)
There are a couple of further call sites that were left unchanged,
either because they are using their own `error` procedure:
* module/ice-9/read.scm
* module/ice-9/command-line.scm
or are not referenced from other modules:
* module/system/base/lalr.upstream.scm:
* module/sxml/upstream/assert.scm:
* module/sxml/sxml-match.ss:
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* module/language/tree-il/optimize.scm (make-optimizer): If the keyword
argument #:dump-optimized-tree-il? is present, print the Tree-IL that
will be handed to the next compiler. Also re-enable #:verify-tree-il?.
Fixes a regression introduced in
4a0c2433d9: the strategy wouldn’t work
when writing to, say, a bytevector output port.
* module/system/vm/linker.scm (link-elf)[write-padding]: Reintroduce
loop for when PORT is not a file port. Remove first argument.
* libguile/ports.c (scm_seek): Let SEEK_DATA and SEEK_HOLE through.
(scm_init_ice_9_ports): Define ‘SEEK_DATA’ and ‘SEEK_HOLE’.
* module/ice-9/ports.scm: Export ‘SEEK_DATA’ and ‘SEEK_HOLE’ when
defined.
* test-suite/tests/ports.test ("size of sparse file")
("SEEK_DATA while on data", "SEEK_DATA while in hole")
("SEEK_HOLE while in hole"): New tests.
* NEWS: Update.
Since ‘*lcm-page-size*’ is 64 KiB, this saves disk space for small ‘.go’
files.
* module/system/vm/linker.scm (link-elf)[write-padding]: Rewrite in
terms of ‘seek’.
* module/language/cps/effects-analysis.scm (compute-clobber-map):
Previously a whole-object read would not be clobbered by a specific
field write. This crops up for the &read introduced at the site of
`cons` for the synthetic car and cdr definitions. This error was there
before but didn't cause bugs before 3.0.10 because cons got eagerly
lowered to separate allocation and initialization instructions.
* module/language/tree-il/inlinable-exports.scm (inlinable-exp): Call
assq-ref in the right order. Embarrassing!
* module/language/tree-il/peval.scm (peval): Print the symbols so that
we can diagnose later failures.
* module/system/foreign.scm (read-fields, write-fields): Don't return
the final offset, as the offset after the final field is not necessarily
the end of the struct, because of padding.
* module/system/foreign.scm (bytevector-complex-single-native-ref)
(bytevector-complex-single-native-set!)
(bytevector-complex-double-native-ref)
(bytevector-complex-double-native-set!): Be more static in our
definitions.
(compile-time-eval):
(switch/compile-time-keys): New helpers.
(align): Make available at compile-time.
(read-field, read-fields, write-field, write-fields): New helpers. More
efficient than the alist.
(write-c-struct, read-c-struct): Rework in terms of new helpers.
(parse-c-struct): Just use sizeof to get the size.
* libguile/foreign.h:
* libguile/foreign.c: Always define complex-float and complex-double.
Fall back to alignof float / 2*sizeof float if no complex numbers. (But
with C99 surely it exists everywhere.)
* module/system/foreign.scm (*writers*, *readers*): Always include
complex-float and complex-double readers and writers.
* test-suite/tests/foreign.test: Always run the complex tests.