* module/ice-9/boot-9.scm (define-option-interface): When printing
options help, e.g. for (read-options 'help), expand the width of the
first column by another tab stop, to accommodate option names of up to
23 characters.
* module/language/tree-il/primitives.scm (maybe-simplify-to-eq): New
helper procedure shared by expanders for 'eqv?' and 'equal?'.
(*primitive-expand-table*): Add expansion rule for 'eqv?'.
* test-suite/tests/tree-il.test ("primitives"): Add tests.
* module/language/tree-il/primitives.scm (*primitive-expand-table*):
Don't simplify 'equal?' to 'not' or 'null?', but only to 'eq?'.
* test-suite/tests/tree-il.test ("primitives"): Adjust tests.
* module/language/tree-il/primitives.scm (*primitive-expand-table*):
Refine test for fixnums to verify that the small integer is exact.
* test-suite/tests/tree-il.test ("primitives"): Add test.
* module/language/tree-il/primitives.scm (*primitive-expand-table*): Add
expansion rules for `equal?', when called with one constant and
another argument.
* test-suite/tests/tree-il.test (pass-if-primitives-resolved): New
macro.
("primitives"): New test prefix.
* module/ice-9/regex.scm (fold-matches): Set regexp/notbol if the
starting position is nonzero.
* test-suite/tests/regexp.test (fold-matches): Check that when
matching /^foo/ against "foofoofoofoo", only one match results.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* module/system/base/compile.scm (ensure-directory): Rename to...
(ensure-directory): ... this. Update callers. When ERRNO is EEXIST,
assume DIR is a writable directory instead of calling `stat' and
`access?' again. Fixes UID/EUID mismatches for setuid binaries.
Reported by rixed@happyleptic.org at
<http://lists.gnu.org/archive/html/guile-user/2012-06/msg00023.html>.
* module/srfi/srfi-31.scm: Use `#:export' instead of `#:export-syntax'.
(rec): Rewrite using `syntax-rules'.
* test-suite/tests/srfi-31.test ("rec special form"): Change exception
type to EXCEPTION:SYNTAX-PATTERN-UNMATCHED.
* doc/ref/srfi-modules.texi ("SRFI-19 Date to string"): Fix iso 8601 format strings.
* module/srfi/srfi-19.scm (directives): Fix iso 8601 format strings.
* module/web/uri.scm (uri-encode): Change test to check for unreserved
chars instead of reserved chars.
* test-suite/tests/web-uri.test ("encode"): Add test.
* module/texinfo.scm (command-spec): Resolve aliases here.
(complete-start-command, make-command-parser):
(make-dom-parser, parse-environment-args): Reload command after
resolving spec, so we get the alias target.
* module/ice-9/psyntax.scm (@): Return top-wrap instead of the wrap
applied to the '@' form, so that the symbol will be interpreted as a
top-level identifier and never refer to any lexical variable.
(@@): Change the syntax used to support R6RS 'library' forms to:
(@@ @@ (mod ...) body). Change the behavior of the documented
(@@ (mod ...) id) form to be the same as that of @, except for the use
of 'private' instead of 'public' in the psyntax mod: use syntax->datum
on the identifier, and return top-wrap instead of the wrap applied to
the '@@' form.
This fixes <http://bugs.gnu.org/10756> reported by Ludovic Courtès.
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/ice-9/r6rs-libraries.scm (library): Use '@@ @@' syntax instead
of the older '@@' syntax.
* test-suite/tests/syncase.test (changes to expansion environment): Use
'@@ @@' syntax.
* module/Makefile.am: Add explicit dependencies for boot-9.go on the
files that it includes: quasisyntax.scm and r6rs-libraries.scm.
* module/web/uri.scm (ipv6-regexp): IPv6 numeric addresses do not have
brackets. It's only in URIs that they have them.
(ipv6-host-pat, authority-regexp, parse-authority): Refactor ipv6
detection to fix a bug with |, and to extract IPv6 hosts from their
brackets. This way we can pass the uri-host directly to inet-pton.
(uri->string): If the host contains a `:', assume it is ipv6 and add
brackets.
* test-suite/tests/web-uri.test ("build-uri"): Adapt tests to assume
that the address returned by uri-host and passed to build-uri #:host
does not have brackets.
* module/web/uri.scm (valid-host?): Support dotted-quad notation
in IPv6 addresses.
(parse-authority): Support IPv6 literals.
* test-suite/tests/web-uri.test: Add and fix tests.
* module/web/uri.scm (valid-host?): Fix regexp to support
domain names starting with numbers.
* test-suite/tests/web-uri.scm: Add tests for above and
IP literals.
* module/ice-9/session.scm (procedure-arguments): Arrange to interpret
numbers in the "req" and "opt" positions of an 'arglist as N arguments
with unknown name.
* module/ice-9/eval.scm (primitive-eval): Set 'arglist on "complex"
procedures. Fixes http://bugs.gnu.org/10922.
* test-suite/tests/session.test ("procedure-arguments"): Add a test.
* module/language/glil/compile-assembly.scm (dump-constants): Only use
the `vector' instruction for vectors whose length can fit in 16 bits.
Fixes http://bugs.gnu.org/11087.
* module/language/tree-il/fix-letrec.scm: Use effects.scm for effects
analysis, instead of primitives.scm.
(simple-expression?, partition-vars): Adapt.
* module/language/tree-il/peval.scm (<operand>): Instead of having a
`residualize?' field, have it be a use count.
(peval): Adapt to <operand> change. Add function to kill uses of an
operand. Use it in the <prompt> inliner. Add another kind of
degenerate prompt to elide. We should really switch to CPS though, as
that will allow us to contify more aggressively.
* test-suite/tests/peval.test ("partial evaluation"): Adapt (while #t
#t) test, which was sensitive to how far the recursive inlining got.
Add a test for the degenerate prompt elision.
* module/language/tree-il/effects.scm (make-effects-analyzer): Be more
precise regarding the effects of the so-called
effect+exception-free-primitives: now we check their arities.
* test-suite/tests/cse.test ("cse"): Add a test that we don't
elide (cons 1 2 3) in effect context.
* module/language/tree-il/peval.scm (peval): Inline applications where
we know the contents of the tail.
* test-suite/tests/peval.test ("partial evaluation"): Add tests.
* module/language/ecmascript/compile-tree-il.scm (current-return-tag):
(with-return-prompt, comp): Compile `return' as an abort instead of a
primcall to `return'. Fixes beta-reduction by the optimizer -- it
doesn't make sense for `return' to move from one function to another!
Fixes <http://bugs.gnu.org/10938>.
Based on a patch by Stefan Israelsson Tampe <stefan.itampe@gmail.com>.
* module/ice-9/session.scm (procedure-arguments): When the 'arglist
property is available, emit the `allow-other-keys?' pair. Use
`match-lambda'.
* test-suite/tests/session.test ("procedure-arguments")["aok? is
preserved"]: New test.
* libguile/objcodes.c: Change to expect objcode on disk to be embedded
in ELF instead of having the funky cookie.
(to_native_order): Use already existing SCM_BYTE_ORDER style byte
order instead of chars.
(bytecode_to_objcode): No need for word_size arg.
(scm_bytecode_to_objcode, scm_objcode_to_bytecode): Take optional
endianness arg instead of sometimes using target-endianness.
(scm_load_objcode, scm_write_objcode, scm_bytecode_to_native_objcode):
Remove.
* libguile/objcodes.h: Adapt.
* libguile/vm.c (scm_load_compiled_with_vm): Use
scm_load_thunk_from_file.
(make_boot_program): Adapt to use scm_bytecode_to_objcode with
endianness arg.
* module/Makefile.am (OBJCODE_LANG_SOURCES): Add (language objcode
elf).
* module/language/objcode/elf.scm: New module, embeds objcode in ELF.
* module/language/bytecode/spec.scm (compile-objcode):
(decompile-objcode): Use (target-endianness).
* module/language/objcode/spec.scm: use (language objcode elf) for
write-objcode.
* module/scripts/disassemble.scm (disassemble):
* module/system/repl/command.scm (disassemble-file): Use
load-thunk-from-file.
* module/system/vm/objcode.scm: Remove load-objcode and write-objcode.
* test-suite/tests/asm-to-bytecode.test (test-target): Adapt to the new
ELF world.
* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
(*effect-free-primitives*): Add string->number, number->string,
integer->char, and char->integer to allow for constant folding and
better effects analysis.
* module/language/tree-il/cse.scm (cse): When trying to fold
conditionals, only look at entries in the database that were added in
test context.
* test-suite/tests/cse.test ("cse"): Add a test case.
* module/ice-9/ftw.scm (scandir): Run the select? procedure on all
items, including subdirs and the `.' and `..' entries. Pass it the
basename of the file in question instead of the full name.
* test-suite/tests/ftw.test ("scandir"): Adapt expectation for the .test
selector. Add test for a selector that rejects everything.
Partly addresses <http://bugs.gnu.org/11197>.
Reported by Klaus Stehle <klaus.stehle@uni-tuebingen.de>.
* module/srfi/srfi-6.scm (open-input-string, open-output-string): New
procedures.
* test-suite/tests/srfi-6.test ("open-input-string")["read-char,
Unicode"]: New test.
("open-output-string")["λ"]: New test.