This is a regression since Guile 3.0.2 and breaks compilation
of a Guile library.
* module/ice-9/read.scm
(%read)[read-parenthesized]: When SAW-BRACE? is #t but CH isn't
#\#, don't eat CH.
* test-suite/tests/reader.test
("#{}#): Add four test cases.
* module/ice-9/read.scm (%read): Add 1 to both line and column: the
former to make 1-based user lines instead of 0-based Guile lines, and
the latter because apparently that's how we always did it :) Fixes
* module/ice-9/read.scm (%read): Adjust how subexpressions are read to
error on EOF. Improve the error message.
* test-suite/tests/reader.test ("#;"): Adapt expectation.
* module/ice-9/read.scm (read-array): Return pair for dimension when len
is given; single number is lbnd for list->typed-array.
* test-suite/tests/arrays.test: More test cases for the reader.
Instead of defining a separate module, given that "read" calls are quite
all over the place, we're just going to replace the boot "read" binding
with read.scm. This way, we'll be able to remove support for reader
options in the boot reader, as it will only ever be used for a finite
set of files.
* NEWS: Update.
* module/Makefile.am (ice-9/boot-9.go): Depend on read.scm.
(SOURCES):
* am/bootstrap.am (SOURCES): Don't build a ice-9/read.go, as we include
it.
* module/ice-9/boot-9.scm (read-syntax): Define here, as "include" now
uses it.
(read-hash-procedures, read-hash-procedure, read-hash-extend): New
procedures. Will replace C variants.
(read, read-syntax): Include read.scm to define these.
* module/ice-9/psyntax-pp.scm (include): Regenerate.
* module/ice-9/psyntax.scm (include): Use read-syntax, so we get better
source information.
* module/ice-9/read.scm (let*-values): New local definition, to avoid
loading srfi-11.
(%read): Use list->typed-array instead of u8-list->bytevector.
* module/language/scheme/spec.scm: Remove (ice-9 read) import;
read-syntax is there in the boot environment
* doc/ref/api-macros.texi (Syntax Case): Update documentation for
datum->syntax.
* module/ice-9/psyntax.scm (datum->syntax): Use #:source keyword for
source location info instead of an optional, and allow an alist.
* module/ice-9/psyntax-pp.scm: Regenerate.
* module/ice-9/read.scm (%read, read): Refactor to allow read and
read-syntax to share an implementation.
(read-syntax): New function.
* module/ice-9/read.scm (read): Use R5RS read-char, peek-char,
write-char rather than (ice-9 textual-ports) wrappers, because the
latter are expressed in terms of the former.
* module/Makefile.am (SOURCES): Add ice-9/read.
* module/ice-9/read.scm: New file. The idea is to move the compiler to
use this "read", after proving that it does the same as C. Then we
can switch to read-syntax that returns syntax objects with source
locations, allowing us to annotate any datum.