1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00
Commit graph

2664 commits

Author SHA1 Message Date
Matt Wette
a5eef0e784 Added comments in load-lang.test, which does not work. * test-suite/tests/load-lang.tests: added comments: The test is not working but execution repl does work. 2023-02-23 21:42:05 +01:00
Matt Wette
a12ca2b999 multiple languages support via file extension or #lang header
From scripts/compile pushed default assumption of #:from as 'scheme down
into system/base/compile where filename and first line can be used to
deduce intended "from" language.  If first line of a file is of the form
  #lang ecmascript
then the file is assumed consist of source language "ecmascript".

* module/scripts/compile.scm (compile): changed default #:from to #f
  from 'scheme

* module/system/base/compile.scm(lang-from-port, %file-extension-map,
  add-lang-extension, lang-extension-for): added global
  %file-extension-map with accessor lang-extension-for and updater
  add-lang-extension.  Also, added lang-from-port to parse  first line,
  looking for #lang.

* test-suite/tests.scm: added "load-lang" test.

* test-suite/Makefile.am(SCM_TESTS): added tests/load-lang.test
2023-02-23 21:41:55 +01:00
Ludovic Courtès
51152392ef Do not expand 'make-vector' primcall with wrong number of arguments.
Fixes <https://bugs.gnu.org/60522>.
Reported by Sascha Ziemann <ceving@gmail.com>.

* module/language/tree-il/primitives.scm (make-vector): Return #f when
passed an incorrect number of arguments.
* test-suite/tests/peval.test ("partial evaluation"): Add tests.
2023-01-16 15:33:18 +01:00
Ludovic Courtès
e441c34f16 Add 'bytevector-slice'.
* module/rnrs/bytevectors/gnu.scm: New file.
* am/bootstrap.am (SOURCES): Add it.
* libguile/bytevectors.c (scm_bytevector_slice): New function.
* libguile/bytevectors.h (scm_bytevector_slice): New declaration.
* test-suite/tests/bytevectors.test ("bytevector-slice"): New tests.
* doc/ref/api-data.texi (Bytevector Slices): New node.
2023-01-14 16:14:17 +01:00
Josselin Poiret
527c257d6e Make 'system*' and 'piped-process' internally use 'spawn'.
Fixes <https://bugs.gnu.org/52835>.

* libguile/posix.c (scm_system_star, scm_piped_process): Use do_spawn.
(start_child): Remove function.
* test-suite/tests/posix.test ("system*")["https://bugs.gnu.org/52835"]:
New test.
* NEWS: Update.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-01-13 16:05:56 +01:00
Josselin Poiret
551929e4fb Add 'spawn'.
* libguile/posix.c: Include spawn.h from Gnulib.
(do_spawn, scm_spawn_process): New functions.
(kw_environment, hw_input, kw_output, kw_error, kw_search_path): New
variables.
* doc/ref/posix.texi (Processes): Document it.
* test-suite/tests/posix.test ("spawn"): New test prefix.
* NEWS: Update.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-01-13 16:05:30 +01:00
Andrew Whatson
fe2a0c54ac Test for 'frame-local-ref' errors when printing backtrace.
This test reproduces the error from <https://bugs.gnu.org/56493>, and
passes with the workaround which was merged in commit
c7fa78fc75.

* test-suite/tests/eval.test ("avoid frame-local-ref out of range"): New
test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-01-11 23:09:07 +01:00
Andy Wingo
ff7328df0d Fix peval bug when expand-primitives introduces lexicals
* module/language/tree-il/peval.scm
(augment-var-table-with-externally-introduced-lexicals): New helper.
* module/language/tree-il/peval.scm (peval): Augment store with any
lexicals introduced by expand-primitives.
* test-suite/tests/peval.test ("partial evaluation"): Add tests.
2022-12-01 13:01:49 +01:00
Andy Wingo
d184d09346 Fix order-of-side-effects bug in (eq? x y z) expansion
* module/language/tree-il/primitives.scm (bind-lexicals): New helper.
(expand-eq, expand-chained-comparisons): Ensure all arguments are
eagerly evaluated.  Previously an intermediate #f result would shortcut
the evaluation.
* test-suite/tests/compiler.test ("size effects in multi-arg eq / <"):
Add test.
2022-12-01 12:56:51 +01:00
Andrew Whatson
02f69c1d84 Add tests for warning locations.
These would have caught <https://bugs.gnu.org/56493>.

* test-suite/tests/tree-il.test ("warnings")("location")["unused
variable", "unbound variable (spaces)", "unbound variable (tabs)"]: New
tests.
2022-11-29 11:41:05 +01:00
Maxime Devos
c8b81ffb34 Define Scheme bindings to ‘openat’ when available.
* configure.ac: Detect if ‘openat’ is defined.
* libguile/filesys.c
  (flags_to_mode): Extract from ...
  (scm_mode): ... here.
  (scm_open_fdes_at, scm_openat): Define the Scheme bindings.
* libguile/filesys.h (scm_open_fdes_at, scm_openat): Make them part
  of the API.
* doc/ref/posix.texi (File System): Document them.
* test-suite/tests/filesys.test ("openat"): Test ‘openat’.
* libguile/syscalls.h (openat_or_openat64): Decide between ‘openat’
  and ‘openat64’.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21 17:42:20 +02:00
Maxime Devos
cf255dd3a4 Define a Scheme binding to ‘fstatat’ when available.
* configure.ac: Detect if ‘fstatat’ is defined.
* libguile/filesys.c (scm_statat): Define a Scheme binding to ‘fstatat’.
* libguile/filesys.h (scm_statat): Make it part of the C API.
* doc/ref/posix.texi (File System): Document it.
* libguile/syscalls.h (fstatat_or_fstatat64): Choose between ‘fstatat’
  and ‘fstatat64’.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21 17:41:10 +02:00
Maxime Devos
3b45185d8f Define a Scheme binding to ‘unlinkat’ when it exists.
‘unlinkat’ is used for both unlinking regular files
and removing empty directories.

* configure.ac: Detect if ‘unlinkat’ exists.
* doc/ref/posix.texi (File System): Document why there is no
  ‘rmdirat’ procedure, and document the ‘delete-file-at’ procedure.
* libguile/filesys.c
  (scm_rmdir): Adjust the docstring here as well.
  (scm_delete_file_at): Define a Scheme binding to ‘unlinkat’.
* libguile/filesys.h (scm_delete_file_at): Make ‘scm_delete_file_at’
  part of the C API.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21 17:40:37 +02:00
Maxime Devos
19b48b1c4a Define a Scheme binding to ‘fchmodat’ when it exists.
* configure.ac: Detect existence of fchmodat.
* libguile/filesys.c (scm_chmodat): New procedure.
* libguile/filesys.h (scm_chmodat): Make it part of the API.
* test-suite/tests/filesys.test ("chmodat"): Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21 17:40:37 +02:00
Maxime Devos
3a0554c60f Define a Scheme binding to ‘renameat’ when it exists.
* configure.ac: Detect if ‘renameat’ is defined.
* libguile/filesys.c (scm_renameat): Define a Scheme binding
  to the ‘renameat’ system call.
* doc/ref/posix.texi (File System): Document it.
* libguile/filesys.h (scm_renameat): Make it part of the C API.
* test-suite/tests/filesys.test ("rename-file-at"): New tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21 17:40:37 +02:00
Maxime Devos
58ddd5c7bc Define bindings to ‘mkdirat’ when the C function exists.
* configure.ac: Detect if ‘mkdirat’ exists.
* libguile/filesys.c (scm_mkdirat): Define the Scheme binding.
* doc/ref/posix.texi (File System): Document it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21 17:40:37 +02:00
Maxime Devos
6c350b6094 Define ‘symlinkat’ wrapper when supported.
* configure.ac: Detect whether ‘symlinkat’ exists.
* libguile/filesys.c (scm_symlinkat): Define a Scheme binding
  when it exists.
* libguile/filesys.h: Make the binding part of the public C API.
* doc/ref/posix.texi (File System): Document the binding.
* test-suite/tests/filesys.test ("symlinkat"): Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21 17:40:37 +02:00
Maxime Devos
9ffd297249 Allow file ports in ‘utime’.
Ports representing symbolic links are currently unsupported.

* configure.ac: Detect 'futimens'.
* doc/ref/posix.texi (utime): Update documentation.
* libguile/posix.c (scm_utime): Support ports.
* libguile/posix.h (scm_utime): Rename argument.
* test-suite/tests/posix.test ("utime"): Add more tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21 17:40:30 +02:00
Maxime Devos
30247dc414 Allow file ports in ‘readlink’.
* configure.ac: Detect whether ‘readlinkat’ is defined.
* libguile/filesys.c (scm_readlink): Support file ports
  when ‘readlinkat’ exists.
  (scm_init_filesys): Provide ‘chdir-ports’ when it exists.
* doc/ref/posix.texi (File System): Document it.
* test-suite/tests/filesys.test ("readlink"): Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21 17:39:38 +02:00
Maxime Devos
273bfe7510 Allow file ports in ‘chdir’ when supported.
* configure.ac: Check for ‘fchdir’.
* libguile/filesys.c
(scm_chdir): Support file ports.
(scm_init_filesys): Report support of file ports.
* doc/ref/posix.texi (Processes): Update accordingly.
* doc/ref/guile.texi: Add copyright line for new documentation in this
patch and later patches.
* test-suite/tests/filesys.test ("chdir"): Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-10-21 17:39:38 +02:00
Mike Gran
9b357bace3 Presume ISO C90 headers are always available
This includes <assert.h>, <ctype.h>, <errno.h>, <float.h>, <iso646.h>,
<limits.h>, <locale.h>, <math.h>, <setjmp.h>, <signal.h>, <stdarg.h>,
<stddef.h>, <stdio.h>, <stdlib.h>, <string.h>, <time.h>, <wchar.h>,
and <wctype.h>.

* configure.ac: don't check for <limits.h>, <string.h>, <time.h>, <assert.h>.
   Remove AC_INCLUDES_DEFAULT macro
* libguile/bytevectors.c: include <limits.h>, remove HAVE_LIMITS_H
* libguile/filesys.c: include <string.h>, remove HAVE_STRING_H
* libguile/fports.c: include <string.h>, remove HAVE_STRING_H
* libguile/gen-scmconfig.c: remove HAVE_LIMITS_H, HAVE_TIME_H, STDC_HEADERS
    Remove SCM_HAVE_STDC_HEADERS
* libguile/hash.c: include <wchar.h>, remove HAVE_WCHAR_H
* libguile/net_db.c: include <string.h>, remove HAVE_STRING_H
* libguile/numbers.h: remove SCM_HAVE_STDC_HEADERS
* libguile/regex-posix.c: include <wchar.h>, remove HAVE_WCHAR_H
  (fixup_multibyte_match): always defined
  (scm_regexp_exec): use fixup_multibyte_match
* libguile/scmsigs.c: remove STDC_HEADERS
* libguile/socket.c: include <string.h>, remove HAVE_STRING_H
* test-suite/standalone/test-unwind.c: include <string.h>, remove HAVE_STRING_H
2022-10-14 08:40:23 -07:00
Daniel Llorens
584ba588e5 Test for out of range depth in fluid-ref*
Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58154, which was
fixed in c0004442b7.
2022-10-03 12:19:58 +02:00
Mike Gran
45cc892fe3 Modifies command line quoting in c-api.test
On MinGW, 'system' uses a non-posix shell that does not handle
apostrophe as a quoting character. For this test, quoting a command-line
with double quotes allows it to be run with both /bin/sh and cmd.exe.

* test-suite/tests/c-api.test (egrep): use double quotes when
  quoting command line
2022-10-02 07:30:48 -07:00
Mike Gran
f5c064576d Avoids deprecated egrep in c-api.test
The standalone egrep script has been deprecated by GNU grep.
'grep -E' is the suggested replacement.

* test-suite/tests/c-api.test (egrep): replace egrep with grep -E
2022-10-02 07:23:52 -07:00
Ludovic Courtès
3ed7673ac0 srfi-35: Fix expansion of 'condition' for compound conditions.
* module/srfi/srfi-35.scm (condition): Use 'make-exception' instead of
'make-compound-condition', which is unbound in this module.
* test-suite/tests/srfi-35.test ("syntax")["compound condition,
hygienic macro expansion"]: New test.
2022-10-01 18:04:16 +02:00
Ludovic Courtès
e2797f529b Baseline compiler no longer crashes on (not (list 1 2)).
Fixes <https://bugs.gnu.org/58217>.

* module/language/tree-il/compile-bytecode.scm (canonicalize)
[finish-conditional](predicate?): Do not assume 'lookup-primitive'
returns true.
* test-suite/tests/compiler.test ("regression tests")
["(not (list 1 2))"]: New test.
2022-10-01 16:00:05 +02:00
Mike Gran
426ed4068a in ftw test, skip EACCESS test on MinGW
MinGW ACL-based permissions don't follow POSIX standard, so
'chmod' has unexpected behavior.

* test-suite/tests/ftw.test (mingw?): new define
  ("file system fold: EACCES"): skip test on MinGW
2022-09-20 19:50:14 -07:00
Mike Gran
775149f0f5 in ftw test, don't presume symlink is defined
* test-suite/tests/ftw.test (dangling symlink and lstat)
  (dangling symlink and stat, symlink to directory):
    skip if symlink undefined
2022-09-20 19:30:38 -07:00
Michael Gran
130463be2a When fork unavailable, skip standalone tests that require it
MinGW is missing fork.

* test-suite/standalone/test-close-on-exec: modified
* test-suite/standalone/test-signal-fork: modified
2022-09-20 15:09:35 -07:00
Ludovic Courtès
61393a5da6 test-suite: Remove obsolete use of 'debug-enable'.
* test-suite/guile-test (enable-debug-mode): Remove 'debug-enable' call.
2022-09-19 22:30:16 +02:00
Ludovic Courtès
1d313bf5f0 'pipe' now takes an optional 'flags' parameter.
This is the same strategy as used for the 'accept4' bindings introduced
in 6e0965104c.

* libguile/posix.c (scm_pipe): Rename to...
(scm_pipe2): ... this.  Add an optional 'flags' parameter and honor it.
(scm_pipe): Rewrite as a call to 'scm_pipe2'.
* libguile/posix.h (scm_pipe2): New declaration.
* test-suite/tests/posix.test ("pipe"): New tests.
* configure.ac: Look for 'pipe2'.
* NEWS: Update.
2022-09-19 22:30:16 +02:00
Ludovic Courtès
a356ceebee Add support for "e" flag (O_CLOEXEC) to 'open-file'.
* libguile/fports.c (scm_i_mode_to_open_flags): Add 'e' case.
(scm_open_file_with_encoding): Document it.
* test-suite/standalone/test-close-on-exec: New file.
* test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.
* doc/ref/api-io.texi (File Ports): Document it.
* NEWS: Update.
2022-09-07 18:00:30 +02:00
Jean Abou Samra
61d8dab8ea In curried definitions, move docstrings to outermost lambda
This makes the docstring attached to the curried function being defined
rather than the result of its application until a function that runs the
body is obtained, fixing
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50068
2022-08-29 11:45:39 +02:00
Ludovic Courtès
56b1ea9002 'system*' can no longer close file descriptor 2.
Fixes <https://bugs.gnu.org/55596>.
Reported by Hugo Nobrega <hugonobrega@ic.ufrj.br>
and Jack Hill <jackhill@jackhill.us>.

* libguile/posix.c (start_child): Close OUT only if it's greater than 2.
* test-suite/tests/posix.test ("system*")["exit code for nonexistent file"]
["https://bugs.gnu.org/55596"]: New tests.
2022-08-05 14:20:51 +02:00
Christopher Baines
baa1424335 web: Don't hide missing data in the chunked input port.
This port is of limited use if it cannot be used reliably. Rather than
behaving as if the input has finished when it ends unexpectedly, instead
raise an exception.

* module/web/http.scm (make-chunked-input-port): Raise an exception on
premature termination.
(&chunked-input-ended-prematurely): New exception type.
(chunked-input-ended-prematurely-error?): New procedure.
* test-suite/tests/web-http.test (pass-if-named-exception): Rename to
pass-if-named-exception.
(pass-if-named-exception): New syntax.
("Exception on premature chunk end"): New test for this behaviour.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-04 11:22:13 +02:00
Christopher Baines
9a3353a993 web: Handle ending CRLF (\r\n) for chunked input and output ports.
The chunked transfer encoding specifies the chunked body ends with
CRLF. This is in addition to the CRLF at the end of the last chunk, so
there should be CRLF twice at the end of the chunked body:

  https://datatracker.ietf.org/doc/html/rfc2616#section-3.6.1

* module/web/http.scm (make-chunked-input-port): Read two extra bytes at
the end of the chunked input.
(make-chunked-output-port): Write the missing \r\n when closing the
port.
* test-suite/tests/web-http.test (chunked encoding): Add missing \r\n to
test data.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-04 11:22:11 +02:00
Aleix Conchillo Flaqué
a84d8f6473 web: send capitalized authorization header scheme
* module/web/http.scm (write-credentials): capitalize authorization
header scheme. The standard allows the scheme to be case-insensitive,
however most libraries out there expect the scheme to be capitalized,
which is what it is actually used in RFC
docs (e.g. https://datatracker.ietf.org/doc/html/rfc7617#section-2). Some
libraries even reject lowercase scheme making Guile incompatible.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-07-04 11:16:36 +02:00
Liliana Marie Prikler
01b686b701 Allow null bytes in UNIX sockets.
The current socket address constructors all assume, that there are no
null bytes in the socket path.  This assumption does not hold in Linux,
which uses an initial null byte to demarcate abstract sockets and
ignores all further null bytes [1].

[1] https://www.man7.org/linux/man-pages/man7/unix.7.html

* libguile/sockets.c (scm_fill_sockaddr)[HAVE_UNIX_DOMAIN_SOCKETS]:
Use scm_to_locale_stringn to construct c_address.
Use memcpy instead of strcpy and calculate size directly instead of
using SUN_LEN.
(_scm_from_sockaddr): Copy the entire path up to the limits imposed by
addr_size.
* test-suite/tests/00-socket.test: ("make-socket-address"): Add case for
abstract unix sockets.
("AF_UNIX/SOCK_STREAM"): Add abstract socket versions of bind, listen,
connect and accept.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2022-06-16 09:54:29 +02:00
Taylor R Campbell
e4e8afd6c8 Allow empty vendor string in GNU target triplets.
NetBSD and pkgsrc have been using an empty vendor string since the
mid-'90s, such as x86_64--netbsd.  pkgsrc has been carrying around a
workaround just the guile build for a long time.  (Before that,
NetBSD omitted the vendor altogether, so if x86_64 existed then it
might have been `x86_64-netbsd', but that caused more problems.)
This change makes Guile accept an empty vendor string so workarounds
are no longer necessary.

* module/system/base/target.scm (validate-target): Allow empty vendor
string in GNU target triplets.
* test-suite/tests/cross-compilation.test ("cross-compilation"): Add
tests for "x86_64--netbsd".

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2022-06-16 09:42:05 +02:00
Rob Browning
6e82a4516a Fix "non-revealed port is closed" ports.test
Don't close the test port's file descriptor because the port still has a
reference to it, and could still close it at any time when finally
garbage collected.  This did soemetimes break subsequent tests.

Bug: https://debbugs.gnu.org/43521
2022-03-16 22:23:37 -05:00
Ludovic Courtès
f18f670223 tests: web-server: Wait until the server is listening.
Fixes synchronization issues observed on slow or loaded machines, where
client connection attempts would fail with ECONNREFUSED:

  https://issues.guix.gnu.org/54348

* test-suite/tests/web-server.test ("server is listening"): New test.
2022-03-15 14:38:40 +01:00
Ludovic Courtès
347321ece9 psyntax: Honor source properties for things other than syntax objects.
Commit 54bbe0b284 inadvertently led
psyntax to dismiss source location info for data returned by read hash
extensions, because read hash extensions return plain data with
associated source properties, even when called from 'read-syntax'.

This change reverts part of this commit to restore that behavior.

Fixes <https://issues.guix.gnu.org/54003>.

* module/ice-9/psyntax.scm (datum-sourcev): New procedure.
(source-annotation): Fall back to 'datum-sourcev'.
* module/ice-9/psyntax-pp.scm: Regenerate.
* test-suite/tests/compiler.test ("psyntax")["syntax-source with
read-hash-extend"]: New test.
2022-03-07 10:52:16 +01:00
Ludovic Courtès
c572b11f3d tests: Add read-syntax + syntax-source test.
* test-suite/tests/reader.test ("read-syntax")["syntax-source"]: New
test.
2022-03-07 10:52:16 +01:00
Daniel Llorens
19bc021e34 Have log and log10(real nan) return real nan regardless of sign
* libguile/numbers.c (log_of_shifted_double, scm_log10): Avoid complex
  extension when the argument is a real nan.
* test-suite/tests/numbers.test: Tests for nans of either sign.
2022-01-13 09:37:17 +01:00
Daniel Llorens
d70c1dbebf New function bitvector-copy (scm_bitvector_copy)
* libguile/bitvectors.h:
* libguile/bitvectors.c: As stated.
* test-suite/tests/bitvectors.test: Tests.
* doc/ref/api-data.texi: Update "Bit vectors" section.
* NEWS: Update.
2022-01-04 12:28:41 +01:00
Daniel Llorens
5759e37181 New function srfi-4-vector-type-size in (srfi srfi-4 gnu)
This patch removes the undocumented function make-srfi-4-vector from
(guile). That function is still exported from (srfi srfi-4 gnu).

* libguile/srfi-4.h (scm_init_srfi_4): Split into scm_bootstrap_srfi_4()
  and scm_init_srfi_4(), after the pattern of scm_init_bytevectors() and
  scm_bootstrap_bytevectors().
* libguile/init.c: Replace scm_init_srfi_4() call by scm_bootstrap_srfi_4().
* module/srfi/srfi-4.scm: Load newly defined srfi-4 extension. This
  provides undocumented make-srfi-4-vector.
* module/srfi/srfi-4/gnu.scm: Export srfi-4-vector-type-size.
* doc/ref/srfi-modules.texi: Document srfi-4-vector-type-size.
2021-12-06 14:00:03 +01:00
Daniel Llorens
496f69dba2 Support C99 complex types in (system foreign)
* libguile/foreign.h (SCM_FOREIGN_TYPE_COMPLEX_FLOAT,
  SCM_FOREIGN_TYPE_COMPLEX_DOUBLE): New enums.
* module/system/foreign.scm (complex-float, complex-double): Export new types.
  (make-c-struct, parse-c-struct): Support the new types.
* libguile/foreign.c (complex-float, complex-double): Define new types.
  (alignof, sizeof, pack, unpack): Support the new types.
* test-suite/tests/foreign.test: Test.
2021-11-15 11:34:09 +01:00
Daniel Llorens
bf9d30f3c3 Limit the range of ash, round-ash count argument to INT32
This avoids gmp aborting e.g. with (ash 1 (expt 2 37)). The new limit is
such that (ash 1 (expt 30)) is accepted but (ash 1 (expt 31)) throws.

Fixes https://bugs.gnu.org/48150

* libguile/numbers.c (ash, round-ash): As stated.
* test-suite/tests/numbers.test: Test a case known to make gmp abort before.
2021-11-05 10:26:43 +01:00
Daniel Llorens
6be51f9bbf Provide xxvector-copy and xxvector-copy! for srfi-4 vectors
These use the argument conventions of vector-copy!, string-copy!,
etc. and not that of bytevector-copy! (which is from r6rs).

* module/srfi/srfi-4/gnu.scm: As stated.
* test-suite/tests/srfi-4.test: Tests.
* doc/ref/srfi-modules.texi: Documentation.
* libguile/bytevectors.c (bytevector-copy!): Add overlap note to
  docstring.
* libguile/vectors.c (vector-copy!): Reuse text for the overlap note.
2021-10-21 15:05:46 +02:00
Timothy Sample
c85724bd0a (ice-9 format): Fix scaling floats with leading zeros 2021-10-19 02:52:15 +02:00