* meta/guile.m4 (GUILE_PKG): Ensure that 'pkg-config' is available. Use
AC_REQUIRE for PKG_PROG_PKG_CONFIG to avoid unnecessary invocations.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.
This is a followup to cb14fd2143.
* doc/ref/api-modules.texi (Creating Guile Modules): Remove bit that
says all the bindings of an autoloaded module become available.
PATCH is described by RFC 5789 and CONNECT is described by RFC 7231.
* module/web/http.scm (parse-http-method): Support CONNECT and PATCH.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* module/ice-9/match.upstream.scm (match-next): Use throw, so that CPS
can see that there's no fallthrough.
* module/ice-9/match.scm: Add a note about what to do in 3.1 to remove
the old "error" definition.
* module/language/tree-il/optimize.scm (make-optimizer): New procedure,
to compute an optimizer given options, lazily loading optimization
modules.
(optimize): Use make-optimizer.
(make-lowerer): Use make-optimizer, so as to only load needed
optimizations. Speeds up bootstrap times.
* module/system/repl/common.scm (repl-default-options): Add
optimization-level and warning-level REPL options.
(repl-optimization-level, repl-warning-level): New accessors,
defaulting to the default level parameters.
(repl-expand): Take target language as keyword argument rather than
hard-coding tree-il.
(repl-optimize): Take target language as keyword argument. Use REPL
optimization and warning levels. Use generic lowering interface.
* 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.
* module/language/tree-il.scm (with-lexicals): New public helper.
* .dir-locals.el (with-lexicals): Add indentation rule.
* module/language/tree-il/compile-bytecode.scm (canonicalize): Use
with-lexicals.
* module/language/tree-il/compile-cps.scm (canonicalize): Use
with-lexicals from tree-il.
* module/language/tree-il/primitives.scm (chained-comparison-expander):
Remove duplicate expander definitions for <, <=, and so on.
* module/language/tree-il/primitives.scm (maybe-simplify-to-eq): Avoid
inadvertent code duplication by using with-lexicals.
(expand-chained-comparisons): Likewise.
(call-with-prompt): Simplify to use with-lexicals.
* libguile/loader.h (SCM_OBJCODE_MINOR_VERSION):
* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump, so
that compiled files from Guile 3.0.3 will error when loaded on 3.0.2.
* module/language/cps/optimize.scm (define-optimizer):
(optimize-higher-order-cps, optimize-first-order-cps):
(make-cps-lowerer):
* module/language/tree-il/optimize.scm (optimize, make-lowerer): In an
embarrassing bug, after parsing optimization arguments, we were
aconsing them instead of the expected cons*. This meant the bootstrap
was running all Tree-IL optimizations! Change to have optimizers not
have defaults and use alists after parsing.
* module/language/tree-il/compile-bytecode.scm (compile-closure):
for-value-at and for-values-at take indexes instead of environments to
denote destination.
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/cps/optimize.scm (cps-optimizations):
* module/language/tree-il/optimize.scm (tree-il-optimizations):
* module/system/base/optimize.scm (available-optimizations): Invert the
dependency tree to hold the names and default optimization levels in a
central place instead of in the optimizers. It moves definitions
farther from uses, but it avoids us having to load the CPS optimizer
if we don't need it, which improves bootstrap times.
* module/language/tree-il/compile-bytecode.scm (compile-closure): Make
it so that for-tail is actually tail-recursive. Likewise improve tail
recursion for the other helpers.
* libguile/jit.c (UNREACHABLE): New register state.
(unreachable): New predicate.
(ASSERT_HAS_REGISTER_STATE): Succeed when unreachable.
(compile_throw, compile_throw_value, compile_throw_value_and_data):
Set unreachable flag.
(compile_receive_values): Reload FP if needed.