summaryrefslogtreecommitdiff
path: root/module
AgeCommit message (Collapse)AuthorFilesLines
2024-11-15psyntax: Inline the single use of define-structureAndy Wingo2-107/+61
* module/ice-9/psyntax.scm (define-structure): Remove, inline into use. No predicate needed. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-14psyntax: Functional annotation of function namesAndy Wingo2-106/+100
* module/ice-9/psyntax.scm (maybe-name-value): Return a fresh lambda instead of mutating the given lambda. (define-expansion-accessors): No need to define setters.
2024-11-14psyntax: Clean up use of fx+, etcAndy Wingo2-98/+81
* module/ice-9/psyntax.scm (fx+, fx-, fx=): Remove. Replace uses with 1+, 1-, =. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-14psyntax: Rename top-level-eval, local-evalAndy Wingo2-28/+26
* module/ice-9/psyntax.scm (top-level-eval, local-eval): Rename from top-level-eval-hook, local-eval-hook. Adapt callers. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-14psyntax: Use vectors instead of gensyms for labels, marksAndy Wingo2-61/+84
* module/ice-9/psyntax.scm (gen-unique): Instead of making a string with an embedded hex counter, make a vector. A little less work than making a string, and slightly smaller binaries. (gen-label, gen-mark): Use gen-unique. (resolve-identifier): Adapt case that recognizes labels denoting lexicals to be less strict. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-14psyntax: Remove useless gen-label invocationsAndy Wingo2-50/+46
* module/ice-9/psyntax.scm (expand-top-sequence): Remove needless gen-label uses, and replace one use with gen-lexical (which is what is needed). * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-14psyntax: Clean up lexical gensym creationAndy Wingo2-69/+75
* module/ice-9/psyntax.scm (gen-lexical): Add a nice comment. Rename from build-lexical-var, and remove unused src argument. (gen-var, generate-temporaries): Use gen-lexical. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-10-26srfi-64: Accept symbols as test group names.Tomas Volf1-2/+13
The specification mandates a string, but with rationale suggesting symbols would be a more natural fit. > In some ways using symbols would be preferable. However, we want > human-readable names, and standard Scheme does not provide a way to include > spaces or mixed-case text in literal symbols. Add support for symbols as an implementation extension and for backwards compatibility with the reference implementation. * module/srfi/srfi-64.scm (%cmp-group-name): New procedure. (test-end): Use it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Reported-by: Daniel Llorens <lloda@sarc.name>
2024-10-25Better REPL behavior on syntax errors in meta commands.Taylan Kammer3-9/+12
Fixes <https://bugs.gnu.org/30600>. * module/system/repl/command.scm (define-meta-command): Flush all remaining input after handling a read error. * module/system/repl/common.scm (flush-all-input): New public procedure. * module/system/repl/repl.scm: Remove local flush-all-input definition.
2024-10-20Replace SRFI-64 with a new implementation.Tomas Volf2-1079/+976
The bundled (reference) implementation was of somewhat mixed quality and it failed to follow standard in multiple places. This commit replaces it with a new one, written from scratch to follow the standard as close as possible. * module/srfi/srfi-64/testing.scm: Delete file. * module/srfi/srfi-64.scm: Replace with new implementation. * am/bootstrap.am (srfi/srfi-64.go): Remove extra dependencies. (NOCOMP_SOURCES): Remove srfi/srfi-64/testing.scm. * test-suite/tests/srfi-64-test.scm ("8.6.1. Simple (form 1) test-apply") ("8.6.2. Simple (form 2) test-apply"): Adjust tests to follow the specification. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-10-12fix typo in commentArne Babenhauserheide1-1/+1
module/ice-9/command-line.scm (compile-shell-switches): fix typo
2024-10-12Create procedure to enable silencing the Guile welcome message. * ↵Matthew Wette1-2/+8
module/system/repl/repl.scm: add parameter `%inhibit-welcome-message' * module/system/repl/repl.scm(run-repl*): add condition for calling procedure repl-welcome: if (%inhibit-welcome-message) is `#t', don't
2024-10-12Redirect diagnostice output messages (e.g., auto-compiling code) to a newly ↵Matthew Wette3-6/+29
defined current-info-port, and add a command line argument `-I' to set the current-info-port to a void-port. * libguile/ports.c: add cur_infoport_fluid, scm_current_info_port, scm_set_current_info_port; define default current-info-port to stderr * libguile/load.c(compiled_is_fresh,load_thunk_from_path, do_try_auto_compile,scm_sys_warn_auto_compilation_enabled, scm_primitive_load_path): direct output messages to current_info_port; was current_warning_port * libguile/init.c(scm_init_standard_ports): set default current_info_port * module/ice-9/ports.scm: define current-info-port and set-current-info-port * module/ice-9/command-line.scm(*usage*,compile-shell-switches): add argument `-I' to silence diagnostics (or current-info-port to void-port) * doc/ref/guile-invoke.texi: add description for `-I' command argument
2024-09-26Run sigbits fixpoint based on use/def graph, not cfgAndy Wingo1-66/+54
* 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.
2024-09-25Tighten up range inference for scm->u64/truncateAndy Wingo1-3/+5
* module/language/cps/types.scm (scm->u64/truncate): Better range analysis.
2024-09-25Fix boxing of non-fixnum negative u64 valuesAndy Wingo1-1/+20
* module/language/cps/specialize-numbers.scm (u64->fixnum/truncate): New helper. (specialize-operations): Fix specialized boxing of u64 values to truncate possibly-negative values, to avoid confusing CSE. Fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71891.
2024-09-25Fix fixpoint needed-bits computation in specialize-numbersAndy Wingo1-17/+10
* 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.
2024-09-24Partially revert d579848cb5d65440af5afd9c8968628665554c22Andy Wingo1-2/+2
* module/language/cps/specialize-numbers.scm (specialize-operations): Accept any operand to logand/immediate, provided the result is a u64 in the right range.
2024-09-23Narrow parameter of logand/immediate if no bits usedAndy Wingo1-3/+5
* module/language/cps/specialize-numbers.scm (specialize-operations): Narrow ulogand/immediate param according to used bits.
2024-09-23Remove needless constraints in type/range analysisAndy Wingo1-10/+1
* 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.
2024-09-23Add a workaround for pre-3.0.10 incorrect inlinable exportsAndy Wingo1-2/+18
* 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 2c645571b351a0044911847025b666551a8e4fb5, 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.
2024-08-26Update psyntax copyright noticeAndy Wingo1-83/+15
* 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.
2024-08-15Fix intset-fold-right on transient intsetsAndy Wingo1-8/+9
* 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!
2024-08-13More thorough lowering of lognot to CPSAndy Wingo1-2/+6
* module/language/tree-il/compile-cps.scm (canonicalize): Lower to a logxor with -1.
2024-07-30Drop libguile srfi-1Rob Browning1-5/+0
...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.
2024-07-30srfi-1 delete-duplicates: move from C to SchemeRob Browning1-0/+46
* libguile/srfi-1.c (scm_srfi1_delete-duplicates): delete. * libguile/srfi-1.h (scm_srfi1_delete-duplicates): delete. * module/srfi/srfi-1.scm: add delete-duplicates.
2024-07-30srfi-1 delete-duplicates!: move from C to SchemeRob Browning1-0/+39
* libguile/srfi-1.c (scm_srfi1_delete-duplicates_x): delete. * libguile/srfi-1.h (scm_srfi1_delete-duplicates_x): delete. * module/srfi/srfi-1.scm: add delete-duplicates!.
2024-07-30srfi-1 lset-difference: use removeRob Browning1-11/+25
* module/srfi/srfi-1.scm (lset-difference): rely on remove like lset-difference!; in addition to being simpler, this allows sharing a common tail.
2024-07-30srfi-1 lset-difference!: move from C to SchemeRob Browning1-0/+24
* libguile/srfi-1.c (scm_srfi1_lset-difference_x): delete. * libguile/srfi-1.h (scm_srfi1_lset-difference_x): delete. * module/srfi/srfi-1.scm: add lset-difference!. * test-suite/tests/srfi-1.test: extend lset-difference! tests to cover lset-difference.
2024-07-30srfi-1 partition!: move from C to SchemeRob Browning1-0/+21
* libguile/srfi-1.c (scm_srfi1_partition_x): delete. * libguile/srfi-1.h (scm_srfi1_partition_x): delete. * module/srfi/srfi-1.scm: add partition!.
2024-07-30srfi-1 partition: move from C to SchemeRob Browning1-0/+22
* libguile/srfi-1.c (scm_srfi1_partition): delete. * libguile/srfi-1.h (scm_srfi1_partition): delete. * module/srfi/srfi-1.scm: add partition.
2024-07-30srfi-1 count: move from C to SchemeRob Browning1-0/+21
* libguile/srfi-1.c (scm_srfi1_count): delete. * libguile/srfi-1.h (scm_srfi1_count): delete. * module/srfi/srfi-1.scm: add count.
2024-07-30srfi-1 length+: move from C to SchemeRob Browning1-0/+24
* libguile/srfi-1.c (scm_srfi1_length_plus): delete. * libguile/srfi-1.h (scm_srfi1_length_plus): delete. * module/srfi/srfi-1.scm: add length+.
2024-07-30srfi-1 append-reverse!: move from C to SchemeRob Browning1-0/+22
* libguile/srfi-1.c (scm_srfi1_append_reverse_x): delete. * libguile/srfi-1.h (scm_srfi1_append_reverse_x): delete. * module/srfi/srfi-1.scm: add append-reverse!.
2024-07-30srfi-1 append-reverse: move from C to SchemeRob Browning1-0/+17
* libguile/srfi-1.c (scm_srfi1_append_reverse): delete. * libguile/srfi-1.h (scm_srfi1_append_reverse): delete. * module/srfi/srfi-1.scm: add append-reverse.
2024-07-30srfi-1 concatenate concatenate!: move from C to SchemeRob Browning1-0/+19
* libguile/srfi-1.c (scm_srfi1_concatenate, scm_srfi1_concatenate_x): delete. * libguile/srfi-1.h (scm_srfi1_concatenate, scm_srfi1_concatenate_x): delete. * module/srfi/srfi-1.scm: add concatenate and concatenate!.
2024-07-30srfi-1 delete delete!: move from C to SchemeRob Browning1-0/+35
* libguile/srfi-1.c (scm_srfi1_delete, scm_srfi1_delete_x): delete. * libguile/srfi-1.h (scm_srfi1_delete, scm_srfi1_delete_x): delete. * module/srfi/srfi-1.scm: add delete and delete!.
2024-07-30srfi-1 remove!: move from C to SchemeRob Browning1-0/+21
* libguile/srfi-1.c (scm_srfi1_remove_x): delete. * libguile/srfi-1.h (scm_srfi1_remove_x): delete. * module/srfi/srfi-1.scm: add remove!.
2024-07-30srfi-1 remove: move from C to SchemeRob Browning1-0/+47
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.
2024-07-30srfi-1 list-copy: move from C to SchemeRob Browning1-0/+18
* libguile/srfi-1.c (scm_srfi1_list_copy): delete. * libguile/srfi-1.h (scm_srfi1_list_copy): delete. * module/srfi/srfi-1.scm: add list-copy. * test-suite/tests/srfi-1.test: ensure copied spine is independent.
2024-07-12define-meta-command: mention effects of a missing categoryRob Browning1-0/+2
module/system/repl/command.scm: add comment.
2024-07-01bug#71304: [PATCH] Add support for 'else' clause in R7RS cond-expand.Maxim Cournoyer1-1/+3
* module/ice-9/r7rs-libraries.scm (define-library) <handle-cond-expand>: Add a pattern to match an 'else' clause. Series-to: bug-guile@gnu.org
2024-06-23Fix race in check-guile to make needless guile-procedures symlinkAndy Wingo1-85/+90
* 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.
2024-06-20Remove dead code in resolve-interfaceAndy Wingo1-4/+2
* module/ice-9/boot-9.scm (resolve-interface): Remove dead code.
2024-06-16Rewrite ‘get-bytevector-all’ in Scheme.Ludovic Courtès1-1/+28
* 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>
2024-06-01wisp: Use uninterned symbols instead of UUIDs.Ludovic Courtès1-36/+45
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’.
2024-06-01Add language/wisp, Wisp tests, and SRFI-119 documentationArne Babenhauserheide2-0/+846
* doc/ref/srfi-modules.texi (srfi-119): add node * module/language/wisp.scm: New file. * module/language/wisp/spec.scm: New file. * test-suite/tests/srfi-119.test: New file. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-05-17make-foreign-object-type: add #:super to provide superclassesRob Browning1-4/+5
* module/system/foreign-object.scm (make-foreign-object-type): allow specification of superclasses via #:super.
2024-05-06Fix error messages containing format stringsMichael Käppler8-16/+30
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>
2024-05-06Fix typos throughout codebase.Morgan Smith11-21/+21
* NEWS: * doc/ref/api-control.texi: * doc/ref/api-data.texi: * doc/ref/api-debug.texi: * doc/ref/api-deprecated.texi: * doc/ref/api-evaluation.texi: * doc/ref/api-foreign.texi: * doc/ref/api-i18n.texi: * doc/ref/api-io.texi: * doc/ref/api-languages.texi: * doc/ref/api-macros.texi: * doc/ref/api-memory.texi: * doc/ref/api-modules.texi: * doc/ref/api-options.texi: * doc/ref/api-peg.texi: * doc/ref/api-procedures.texi: * doc/ref/api-scheduling.texi: * doc/ref/api-undocumented.texi: * doc/ref/api-utility.texi: * doc/ref/expect.texi: * doc/ref/goops.texi: * doc/ref/misc-modules.texi: * doc/ref/posix.texi: * doc/ref/repl-modules.texi: * doc/ref/scheme-ideas.texi: * doc/ref/scheme-scripts.texi: * doc/ref/srfi-modules.texi: * gc-benchmarks/larceny/dynamic.sch: * gc-benchmarks/larceny/twobit-input-long.sch: * gc-benchmarks/larceny/twobit.sch: * libguile/gc.h: * libguile/ioext.c: * libguile/list.c: * libguile/options.c: * libguile/posix.c: * libguile/threads.c: * module/ice-9/boot-9.scm: * module/ice-9/optargs.scm: * module/ice-9/ports.scm: * module/ice-9/pretty-print.scm: * module/ice-9/psyntax.scm: * module/language/elisp/parser.scm: * module/language/tree-il/compile-bytecode.scm: * module/srfi/srfi-37.scm: * module/srfi/srfi-43.scm: * module/statprof.scm: * module/texinfo/reflection.scm: * test-suite/tests/eval.test: * test-suite/tests/fluids.test: Fix typos. Signed-off-by: Ludovic Courtès <ludo@gnu.org>