* libguile/strports.c (scm_mkstrport): Use UTF-8; ignore
%default-port-encoding. Rename 'str_len' and 'c_pos' to
'num_bytes' and 'c_byte_pos'. Interpret 'pos' argument
as a character index instead of a byte index.
* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-6 to the
list of core features.
* module/srfi/srfi-6.scm (open-input-string, open-output-string): Simply
re-export these, since the core versions are now compliant.
* doc/ref/api-io.texi (String Ports): Remove text that describes
non-compliant behavior of string ports with regard to encoding.
* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-6 to the list of
core features.
(SRFI-6): Remove text that mentions non-compliant behavior of
core string ports.
* module/ice-9/format.scm (format):
* module/ice-9/pretty-print.scm (truncated-print):
* module/rnrs/io/ports.scm (open-string-input-port,
open-string-output-port):
* test-suite/test-suite/lib.scm (format-test-name):
* test-suite/tests/chars.test ("combining accent is pretty-printed",
"combining X is pretty-printed"):
* test-suite/tests/ecmascript.test (eread, eread/1):
* test-suite/tests/rdelim.test:
* test-suite/tests/reader.test (read-string):
* test-suite/tests/regexp.test:
* test-suite/tests/srfi-105.test (read-string): Don't set
%default-port-encoding before creating string ports.
* benchmark-suite/benchmarks/ports.bm (%latin1-port): Use
'set-port-encoding!' to set the string port encoding.
(%utf8/ascii-port, %utf8/wide-port, "rdelim"): Don't set
%default-port-encoding before creating string ports.
* test-suite/tests/r6rs-ports.test ("lookahead-u8 non-ASCII"): Don't set
%default-port-encoding before creating string ports.
("put-bytevector with UTF-16 string port", "put-bytevector with
wrong-encoding string port"): Use 'set-port-encoding!' to set the
string port encoding.
* test-suite/tests/print.test (tprint): Use 'set-port-encoding!' to set
the string port encoding.
("truncated-print"): Use 'pass-if-equal'.
* test-suite/tests/ports.test ("encoding failure leads to exception",
"%default-port-encoding is honored", "peek-char [latin-1]", "peek-char
[utf-8]", "peek-char [utf-16]"): Remove tests.
("%default-port-encoding is ignored", "peek-char"): Add tests.
("suitable encoding [latin-1]", "suitable encoding [latin-3]",
"wrong encoding, error", "wrong encoding, substitute",
"wrong encoding, escape"): Use 'set-port-encoding!' to set the
string port encoding.
("%default-port-encoding, wrong encoding"): Rewrite to use
a file port instead of a string port.
Suggested by Ludovic Courtès <ludo@gnu.org>.
* doc/ref/srfi-modules.texi (SRFI-41 Stream Primitives):
Label 'stream-null' as a Scheme Variable, not a Constant.
Incorporates suggestions from Mark H Weaver <mhw@netris.org>
and Ian Price <ianprice90@googlemail.com>.
* module/srfi/srfi-41.scm: New file.
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-41.scm.
* test-suite/tests/srfi-41.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-41.test.
* doc/ref/srfi-modules.texi (SRFI Support): Add SRFI-41.
(SRFI-41): New node which refers the reader to
<http://srfi.schemers.org/srfi-41/srfi-41.html>.
* module/srfi/srfi-45.scm (promise?): Export.
* doc/ref/srfi-modules.texi (SRFI-45): Update docs.
* test-suite/tests/srfi-45.test: Add test. Add FSF copyright for 2010
and 2013. Add missing year to André van Tonder's copyright notice.
* module/ice-9/boot-9.scm (%cond-expand-features): Remove redundant list
of feature identifiers in the comment. Explain more clearly what
belongs in this list. Remove srfi-6.
* module/srfi/srfi-4.scm, module/srfi/srfi-27.scm,
module/srfi/srfi-31.scm, module/srfi/srfi-38.scm,
module/srfi/srfi-39.scm, module/srfi/srfi-42.scm,
module/srfi/srfi-45.scm, module/srfi/srfi-67.scm: Add missing
'cond-expand-provide'.
* module/srfi/srfi-69.scm: Fix erroneous 'cond-expand-provide'.
* doc/ref/srfi-modules.texi (SRFI-0): Update the list of features in
Guile core.
* doc/ref/srfi-modules.texi (About SRFI Usage): Use SRFI-13 as an
example of a module which is included in core Guile, instead of
SRFI-6.
(SRFI-6): Mention the non-conformance of the core 'open-input-string'
and 'open-output-string' procedures. Remove the claim that importing
this module does nothing. Recommend that users import the module.
* module/srfi/srfi-45.scm (eager): Accept any number of arguments.
Store the list of arguments in the value record. Previously, only one
argument was accepted, and that value was stored in the value record.
(delay): Support expressions that return any number of arguments.
(force): Return the list of values stored in the value record.
(promise?): Export.
* doc/ref/srfi-modules.texi (SRFI-45): Update docs. Remove typing
for simplicity in discussing multiple values.
* test-suite/tests/srfi-45.test: Add tests. Add FSF copyright for 2010
and 2013. Add missing year to André van Tonder's copyright notice.
* doc/ref/api-debug.texi:
* doc/ref/api-evaluation.texi:
* doc/ref/api-modules.texi:
* doc/ref/compiler.texi:
* doc/ref/web.texi: Make Texinfo function headers more consistent.
Change lesser used keyword notation to the predominant form.
* doc/ref/api-procedures.texi: Fix an argument name in a header that should
use repeated argument notation.
* doc/ref/srfi-modules.texi: Update references in Texinfo function
definition body to match previously updated variable notation in
definition header.
Suggested by Mark Weaver.
* doc/ref/srfi-modules.texi (SRFI-9): Keep the node, but move contents
to...
* doc/ref/api-compound.texi (SRFI-9 Records): ...here.
(Record Overview): New section.
Moved scm_i_struct_hash from struct.c to hash.c and made it static.
The port's alist is now a field of 'scm_t_port'.
Conflicts:
libguile/arrays.c
libguile/hash.c
libguile/ports.c
libguile/print.h
libguile/read.c
* libguile/private-options.h: Add SCM_CURLY_INFIX_P macro, and increment
SCM_N_READ_OPTIONS.
* libguile/read.c (sym_nfx, sym_bracket_list, sym_bracket_apply): New
variables.
(scm_read_opts): Add curly-infix reader option. Reformat to comply
with GNU coding standards.
(scm_t_read_opts): Add curly_infix_p and neoteric_p fields.
(init_read_options): Initialize new fields.
(CHAR_IS_DELIMITER): Add '{', '}', '[', and ']' as delimiters if
curly_infix_p is set.
(set_port_square_brackets_p, set_port_curly_infix_p): New functions.
(read_inner_expression): New function which contains the code that was
previously in 'scm_read_expression'. Handle curly braces when
curly_infix_p is set. If curly_infix_p is set and square_brackets_p
is unset, follow the Kawa convention: [...] => ($bracket-list$ ...)
(scm_read_expression): New function body to handle neoteric
expressions where appropriate.
(scm_read_shebang): Handle the new reader directives: '#!curly-infix'
and the non-standard '#!curly-infix-and-bracket-lists'.
(scm_read_sexp): Handle curly infix lists.
* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-105 feature
identifier.
* doc/ref/srfi-modules.texi (SRFI-105): Add stub doc for SRFI-105.
* doc/ref/api-evaluation.texi (Scheme Read): Add documentation for the
'curly-infix' read option, and the '#!curly-infix' and
'#!curly-infix-and-bracket-lists' reader directives.
* doc/ref/api-options.texi (Runtime Options): Add 'curly-infix' to the
list of read options.
* test-suite/Makefile.am: Add tests/srfi-105.test.
* test-suite/tests/srfi-105.test: New file.
* 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.
* doc/ref/api-compound.texi
* doc/ref/api-evaluation.texi
* doc/ref/api-foreign.texi
* doc/ref/api-io.texi
* doc/ref/posix.texi
* doc/ref/srfi-modules.texi: Add missing parentheses and commas to definitions
of C functions.
* doc/ref/api-data.texi: Change from @deffn to @deftypefn for C function
with arguments not of SCM type.
* doc/ref/intro.texi (Introduction):
* doc/ref/scheme-reading.texi (Further Reading):
* doc/ref/srfi-modules.texi (SRFI Support): Fix some urls. Thanks to
Henrik Sandklef for the report.
The expansion of `define-inlinable' contained an expression, which made
SRFI-9's `define-record-type' fail in non-toplevel contexts ("definition
used in expression context").
* module/srfi/srfi-9.scm (define-inlinable): Get rid of apparently
useless expression in the expansion, so the expansion yields only
definitions. At the same time, use a space in the generated names to
lessen the chances of name conflicts, also avoiding -Wunused-toplevel
warnings.
* test-suite/tests/srfi-9.test (non-toplevel): New test verifying that
`define-record-type' works in non-toplevel context as well.
* doc/ref/srfi-modules.texi (SRFI-9 - define-record-type): Add
subsubsection noting that Guile does not enforce top-levelness.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* module/srfi/srfi-38.scm: New file, partly based on the reference
implementation and on Alex Shinn's public-domain implementation for
Chicken.
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-38.scm.
* test-suite/tests/srfi-38.test: New file, minimal test suite for SRFI
38.
* test-suite/Makefile.am (SCM_TESTS): Added tests/srfi-38.test.
* doc/ref/srfi-modules.texi: Add a node for SRFI 38.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* module/srfi/srfi-45.scm: New file, containing the reference implementation of
SRFI 45, slightly adapted to use SRFI-9.
* module/Makefile.am (SRFI_SOURCES): Added srfi/srfi-45.scm.
* test-suite/tests/srfi-45.test: New file.
* test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-45.test.
* doc/ref/srfi-modules.texi (SRFI-45): New node and subsection;
essentially a shortended transcript of the SRFI-45 specification.
* module/srfi/srfi-42/ec.scm: New file; reference implementation of
SRFI 42.
* module/srfi/srfi-42.scm: New file; module for SRFI 42.
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-42.scm.
(NOCOMP_SOURCES): Add srfi/srfi-42/ec.scm.
* test-suite/tests/srfi-42.test: New file; test suite for SRFI 42.
* test-suite/Makefile.am: SCM_TESTS: Add tests/srfi-42.test.
* doc/ref/api-evaluation.texi (Scheme Read): Fold all reader options
docs into this section. Undocument read-options-interface.
(Scheme Write): New section for `write' and `display', and the print
options. print-enable/print-disable are not documented, as there are
no boolean print options. print-options-interface is likewise
undocumented.
* doc/ref/api-options.texi: Remove discussion of options in
general. Move read options to Scheme Read, and print options to Scheme
Write.
* doc/ref/api-io.texi (Reading): Link to Scheme Read.
(Writing): Move write and display to Scheme Write, and link there.
* doc/ref/srfi-modules.texi:
* doc/ref/api-debug.texi:
* doc/ref/api-data.texi: Update xrefs.
* module/srfi/srfi-27.scm: New file; implementation of SRFI 27 in terms
of the existing random number generator.
* module/Makefile.am (SRFI_SOURCES): Add srfi/srfi-27.scm.
* test-suite/tests/srfi-27.test: New file; minimal test suite for SRFI 27.
* test-suite/Makefile.am (SCM_TESTS): Add tests/srfi-27.test.
* doc/ref/srfi-modules.texi: Add subsection on SRFI-27 based
on the specification.