summaryrefslogtreecommitdiff
path: root/module
AgeCommit message (Collapse)AuthorFilesLines
2025-03-22Improve DLL search strategy for load-foreign-libraryMichael Gran1-15/+136
The new non-libltdl foreign library loading algorithm from 3.0.6 fails to cover common cases regarding how libtool names and installs DLL files. Notably, it fails to recognize when libtool has added the major version number into the filename itself, such as libfoo-1.dll Also, it does not search in binary directories and the PATH for DLL files, where libtool is likely to install DLLs. This adds the option to search for dlls with major version numbers in the filename, and modifies the search strategy for DLL-using OSs to check bindir and PATH. For MSYS, libraries are installed with the 'msys-' prefix. So this modifies load-foreign-library to handle that prefix as well. It changes the #:rename-on-cygwin? option to #:host-type-rename? to better reflect that is works on both Cygwin and MSYS. Partially based on a patch by Hannes Müller. * NEWS: updated * doc/ref/api-foreign.texi: document updates to load-foreign-library and system-dll-path * module/system/foreign-library.scm (is-integer-string?): new utility function (dll-name-match?): new utility function (find-best-dll-from-matches): new utility function (dll-exists-with-version): new function that implements new dll search logic (file-exists-with-extension): add flag argument to allow new dll search (file-exists-in-path-with-extension): add flag argument to all new dll search (system-dll-path): new parameter (lib->msys): new helper function (load-foreign-library): add new optarg flag #:allow-dll-version-suffix? Pass new flag to library search functions. Implement new search strategy for #:search-system-paths? on DLL systems' replace #:rename-on-cygwin? with #:host-type-rename? Use that option to rename both MSYS and Cygwin libraries. (guile-system-extensions-path): prefer bindir to libdir on DLL systems * test-suite/tests/foreign.test ("dll-name-match?"): new test category ("find-best-dll-from-matches"): new test category ("lib->msys"): new unit tests
2025-03-20Fix typo in transform-string docstringArun Isaac1-2/+2
* module/texinfo/string-utils.scm (transform-string): Replace "te" with "the" in docstring. Fixes: 42228
2025-03-02Allow trailing "." in urlsDale P. Smith1-7/+10
Fixes https://debbugs.gnu.org/53201 * module/web/uri.scm (valid-host?): Allow trailing "." in URLs * test-suite/tests/web-uri.test: Add tests for trailing "."
2025-02-28Fix make-custom-port in case encoding is #fHannes Müller1-1/+1
* module/ice-9/custom-ports.scm (make-custom-port): Code fails if (fluid-ref %default-port-encoding) returns #f. In fact this was the case why readline support on MSYS2 failed for guile 3.0.10, ref. https://github.com/msys2/MSYS2-packages/issues/5079 But later used canonicalize-encoding is prepared to handle #f for encoding. So allow encoding to also handle this case. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28srfi-19: Fix ~V converter in date->string.Tomas Volf1-1/+22
The ~V is supposed to print ISO week number, not a week number. This commit fixes that. * module/srfi/srfi-19.scm (date-week-number-iso): New procedure taken from the reference implementation. (directives)<#\V>: Use it. * test-suite/tests/srfi-19.test ("date->string ~V"): Add tests taken from the reference test suite. * doc/ref/srfi-modules.texi (SRFI-19 Date to string): Mention ISO-8601 in description for ~V. Fixes <https://bugs.gnu.org/74841>. Edited by lloda <lloda@sarc.name>.
2025-02-28Fix typos in comments.Tomas Volf3-3/+3
* module/sxml/xpath.scm: Fix typo in a comment. * module/sxml/upstream/SXPath-old.scm: Same. * doc/ref/sxml.texi (SXPath): Reflect in the documentation. * doc/ref/texinfo.texi (string-utils): Fix same typo. * module/texinfo/string-utils.scm (expand-tabs): Same. Fixes <https://bugs.gnu.org/76621>. Edited by lloda <lloda@sarc.name>.
2025-02-20Fix string-utf8-length to have unboxed representationAndy Wingo1-1/+1
* module/language/cps/utils.scm (primcall-raw-representations): Add string-utf8-length.
2025-01-27Avoid accidentally-quadratic use of intmap-keysAndy Wingo1-14/+19
* module/language/cps/utils.scm (compute-reachable-functions): Rework to not call intmap-keys on a data structure that we are building up in a loop.
2025-01-22Optimize ordering edges in fix-letrecAndy Wingo1-2/+4
* module/language/tree-il/fix-letrec.scm (compute-sccs): Instead of depending on all previous complex bindings, we can just depend on the most recent one. Decreases the graph size.
2025-01-22Use transient intset/intmap optimizations when computing SCCsAndy Wingo1-14/+16
* module/language/cps/graphs.scm (compute-sorted-strongly-connected-components): Use more transient data structures.
2025-01-22Fix bad algorithmic growth in fix-letrecAndy Wingo1-153/+216
We were using list sets, which when you end up with thousands of bindings in an SCC reaches the point where we are off the quadratic end of the curve. Fix to use intsets and intmaps instead. * module/language/tree-il/fix-letrec.scm (compute-ids): New function. (compute-referenced-and-assigned): Rename from analyze-lexicals, and compute intsets. (make-compute-free-variables): Rename from free-variables, return a procedure instead of a hash table, and use intsets. Use a global cache to avoid quadratic behavior with regard to binding depth. (compute-complex): Compute a global set of "complex" variables, as an intset. (compute-sccs): Use intsets and intmaps to compute the free-variable and ordering edges. (fix-scc, fix-term): Refactorings. (reorder-bindings): Avoid a linear search. (fix-letrec): Refactor.
2025-01-22Fix a check in the Tree-IL verifierAndy Wingo1-2/+2
* module/language/tree-il/debug.scm (verify-tree-il): Fix pattern-matching.
2025-01-16Fix bug in srfi-111 box printerDaniel Llorens1-1/+1
* module/srfi/srfi-111.scm: Add missing port. * test-suite/tests/srfi-111.test: Test.
2024-12-22doc: srfi-19: Use `day' instead of `date' for `make-date'.Tomas Volf1-12/+12
Looking at the SRFI-19 specification, the argument is called `day', not `date'. Even the accessor is called `date-day'. So adjust the documentation to match. Also adjust the (web http) module, which was using `date' as well. * doc/ref/srfi-modules.texi (SRFI-19 Date): Use `day' instead of `date'. * module/web/http.scm (parse-rfc-822-date, parse-rfc-850-date) (parse-asctime-date): Same. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-22PEG: string-peg: Better support for escaping.Ekaitz Zarraga1-3/+23
* module/ice-9/peg/string-peg.scm (peg-as-peg): Augment with rules for hexadecimal digits, “\uXXX” for characters, “\t” for tabs, etc. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-22PEG: string-peg: Fix [^...] interpretation.Ekaitz Zarraga1-4/+12
* module/ice-9/peg/string-peg.scm (NotInClass->defn): Adjust. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-19New line or field iteration procedures in (ice-9 rdelim)Adam Faiz1-1/+34
* NEWS: Update * module/ice-9/rdelim (for-rdelim-from-port, for-delimited-from-port, for-line-in-file): New procedures. * doc/ref/api-io.texi: Documentation of `for-rdelim-for-port`-related procedures. * test-suite/tests/rdelim.test: Tests for `for-rdelim-for-port`-related procedures. Signed-off-by: Mikael Djurfeldt <mikael@djurfeldt.com>
2024-12-09PEG: Add support for `not-in-range` and [^...]Ekaitz Zarraga2-3/+57
Modern PEG supports inversed class like `[^a-z]` that would get any character not in the `a-z` range. This commit adds support for that and also for a new `not-in-range` PEG pattern for scheme. * module/ice-9/peg/codegen.scm (cg-not-in-range): New function. * module/ice-9/peg/string-peg.scm: Add support for `[^...]` * test-suite/tests/peg.test: Test it. * doc/ref/api-peg.texi: Document accordingly. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-09PEG: Add full support for PEG + some extensionsEkaitz Zarraga1-166/+280
This commit adds support for PEG as described in: <https://bford.info/pub/lang/peg.pdf> It adds support for the missing features (comments, underscores in identifiers and escaping) while keeping the extensions (dashes in identifiers, < and <--). The naming system tries to be as close as possible to the one proposed in the paper. * module/ice-9/peg/string-peg.scm: Rewrite PEG parser. * test-suite/tests/peg.test: Fix import Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-06Temporarily revert commit 7379049d3 (to make Guile bootstrap)Mikael Djurfeldt2-155/+79
2024-11-27Bugfix: Recursively use method*, not method, in method*Mikael Djurfeldt1-5/+4
* module/oop/goops.scm (method*): Do not use method.
2024-11-26Add comment about (oop goops keyword-formals)Mikael Djurfeldt1-1/+8
2024-11-26New module (oop goops keyword-formals)Mikael Djurfeldt1-0/+31
This module replaces the method and define-method bindings with their method* and define-method* counterparts, for use by users who prefer not to use both kinds of syntactic forms. * module/oop/goops/keyword-formals.scm: New module. * am/bootstrap.am: Added * doc/ref/goops.texi: Document this change.
2024-11-25Correctly pass on keyword arguments actually present in args listMikael Djurfeldt1-23/+58
* module/oop/goops.scm (compute-keyword-formal-ids): Renamed from ->keyword-formal-ids; modified to do work both on the list of formals and the list of formal ids in the next-method call. (compute-make-procedure): Use compute-keyword-formal-ids.
2024-11-25Distinguish between lambda and lambda* in generated proceduresMikael Djurfeldt1-34/+47
* module/oop/goops (compute-procedure, compute-make-procedure): Emit lambda or lambda* as appropriate. This doesn't matter now since all will boil down to lambda-case, but to be future-proof... Also add some clarifying comments.
2024-11-25Remove method slot keyword-formals? introduced in 765f1d49Mikael Djurfeldt1-10/+2
* module/oop/goops.scm (method-keyword-formals?): Remov method slot keyword-formals? as well as exported procedure method-keyword-formals? introduced in 765f1d49 by partially reverting that commit.
2024-11-25GOOPS: Introduce new forms method* and define-method*Mikael Djurfeldt1-12/+107
* module/oop/goops.scm: Export method* and define-method*. (define-method): Extract definitions of helper procedures and place them in an eval-when at top level. (define-method*): Renamed from last commits define-method and modified to invoke method*. (define-method): New syntax. (parse-keyword-formals): Renamed from parse-formals and modified to give keyword methods a specialzers list with tail <top>. (parse-formals): Re-introduce the code of previous parse-args. (%compute-applicable-methods): Revert change of previous commit. Giving keyword methods a specializer tail <top> naturally makes original %compute-applicable-methods work also with keyword methods (which kind of shows that we have made the correct choices). (method*): Renamed from last commit's "method". (method): New syntax.
2024-11-25GOOPS: Add support for keyword arguments in methodsMikael Djurfeldt1-46/+131
* module/oop/goops.scm (keyword-formals?): New slot in <method>. (method-keyword-formals?): New exported <method> getter. (%compute-applicable-methods): Treat method as applicable if having matched all specializers, still have further arguments and have keyword-formals. (%compute-applicable-methods): Remove unused local variable n. (define-syntax method): Rename parse-args to parse-formals. (parse-formals): Return formals, specializers and keyword-formals. (compute-procedure): Make a lambda* with possibly keyword formals. (->formal-ids): Renamed from ->proper and now returns formal-ids. (->keyword-formal-ids): New procedure. Filter out formal ids from a keyword formal specification. (compute-make-procedure): Adapted for keyword formals. Needs ->formal-ids and ->keyword-formal-ids to compute the real-next-method call. (compute-procedures): Pass on keyword-formals. (syntax method): Adapted for keyword formals.
2024-11-25psyntax: simplify free-id=?Andy Wingo2-66/+65
* module/ice-9/psyntax.scm (free-id=?): Simplify. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-20psyntax: Cosmetic change to overriden globalsAndy Wingo2-258/+270
* module/ice-9/psyntax.scm (define/override, define*/override): Use instead of set! on globals. ($sc-dispatch): Renest. Will compile to the same thing as before. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-19psyntax: Reorder global-extendAndy Wingo1-6/+4
* module/ice-9/psyntax.scm (global-extend): Put at the beginning. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-19psyntax: Typo fixAndy Wingo1-1/+1
* module/ice-9/psyntax.scm: Fix comment typo.
2024-11-19psyntax: Cosmetic changeAndy Wingo1-3/+1
* module/ice-9/psyntax.scm (build-simple-lambda): Reflow.
2024-11-19psyntax: Clean up sourcev/src namingsAndy Wingo2-19/+18
* module/ice-9/psyntax.scm: Look forward to the all-sourcev world by just naming things "src". * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-19psyntax: Simplify output constructors.Andy Wingo2-119/+82
* module/ice-9/psyntax.scm: Eta-reduce build-void, build-call, et al. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-19psyntax: Factor module-variable use to helpersAndy Wingo2-78/+156
* module/ice-9/psyntax.scm (resolve-module*, resolve-variable): New helpers. (free-id=?, resolve-identifier): Use new helpers. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-19psyntax: Remove stale analyze-variable caseAndy Wingo2-70/+61
* module/ice-9/psyntax.scm (analyze-variable): Remove "bare" case, long gone. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-18psyntax: Separate core expanders from their installationAndy Wingo2-1387/+1417
* module/ice-9/psyntax.scm (expand-let, expand-letrec, ...): Name these expanders, then install them. Allows for better code evolution and decreases the indent. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-18psyntax: Remove pre-3.0 hack about syntax transformer bindings.Andy Wingo2-40/+35
* module/ice-9/psyntax.scm (resolve-identifier): Remove "transformer is a pair" case. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-18psyntax: Simplify to first-order bindings. NFCAndy Wingo2-82/+84
* module/ice-9/psyntax.scm (no-source, make-empty-ribcage): Make normal bindings, not macros.
2024-11-18psyntax: Match when rebuilding macro outputAndy Wingo2-87/+176
* module/ice-9/psyntax.scm (expand-macro): Use match. (eval-local-transformer): Use unless for side effect. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-18psyntax: Cleanups; ensure order of top-level expansionAndy Wingo1-64/+71
* module/ice-9/psyntax.scm (build-lexical-reference): No "type" parameter. Adapt callers. (valid-bound-ids?, distinct-bound-ids?, bound-id-member?): Use match. (expand-sequence, expand-top-sequence): Use match. For expand-top-sequence, ensure that both phases of expansion are run in order; was the case before, but by accident. Don't accumulate results in reverse. (parse-when-list): Use match.
2024-11-18psyntax: Simplify locally-bound-identifiersAndy Wingo2-111/+149
* module/ice-9/psyntax.scm (locally-bound-identifiers): Simplify to use match and scope. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-18psyntax: Simplify id-var-nameAndy Wingo2-159/+255
* module/ice-9/psyntax.scm (id-var-name): No need for `search` to return the marks. Simplify to use scope instead of repeating, and use match. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-18psyntax: Fix bug introduced in 029540948367fe522f9a105f403c12Andy Wingo2-61/+57
* module/ice-9/psyntax.scm (analyze-variable): Fix erroneous pattern matching. * module/ice-9/psyntax-pp.scm: Regenerate.
2024-11-15psyntax: Use new `match' instead of cdadringAndy Wingo2-190/+280
* module/ice-9/psyntax-pp.scm: Regenerate. * module/ice-9/psyntax.scm: Use `match' more. Also use more first-order definitions. NFC.
2024-11-15psyntax: Use new `match' instead of cdadringAndy Wingo2-107/+154
* module/ice-9/psyntax-pp.scm: Regenerate. * module/ice-9/psyntax.scm: Use `match' more. NFC.
2024-11-15psyntax: Add simple pattern matcherAndy Wingo2-38/+92
* module/ice-9/psyntax.scm (simple-match1, simple-match-pat, simple-match-patv, match): Add simple pattern matcher. * module/ice-9/psyntax-pp.scm: Regenerate. Just different renumbering of temps.
2024-11-15psyntax: Avoid lambda in procedure definitionsAndy Wingo1-1640/+1552
* module/ice-9/psyntax.scm: Instead of e.g. (define foo (lambda (x) ...)), do (define (foo x) ...). No functional change.
2024-11-15psyntax: Remove a useless level of letAndy Wingo1-2779/+2778
* module/ice-9/psyntax.scm: Remove let around the body.