* module/ice-9/peg.scm (cg-generic-ret): Remove unused for-syntax
argument.
(peg-sexp-compile): Take the pattern as syntax directly, and use
syntax-case to destructure it and dispatch to the code generators.
(cg-and, cg-and-int, cg-or, cg-or-int): Refactor to operate on syntax
instead of on s-expressions.
(cg-body): Likewise; though this was a larger refactor.
(define-nonterm, peg-match): Adapt to peg-sexp-compile calling
convention change.
(peg-string-compile): Likewise, and just take the grammar as a syntax
object.
* module/ice-9/peg.scm (cg-generic-lambda, cggl): Remove these helpers,
they are no longer needed.
(cg-generic-ret): Remove optimization for particular cg- routines, as
it's no longer needed.
* module/ice-9/peg.scm (cggl-syn, cggr-syn): New functions, equivalent
to cggl and cggr except that they operate on syntax instead of
s-expressions.
(cg-string): Use them here.
* module/ice-9/peg.scm (peg-sexp-compile): Push datum->syntax call
through cond expression in peg-sexp-compile. This is a preliminary
move so that I can convert the code-generating functions into
syntax-generating functions one by one.
* module/ice-9/iconv.scm (call-with-encoded-output-string):
(string->bytevector, bytevector->string): Only call string->utf8 and
utf8->string if the conversion strategy is `error'.
* module/rnrs/io/ports.scm (binary-port?): All ports are binary _and_
textual. Bytevectors and strings may be written to or read from
either.
(port-transcoder): All textual ports (all ports) have transcoders of
some sort.
* test-suite/tests/r6rs-ports.test ("8.2.6 Input and output ports"):
Remove test that binary ports don't have transcoders, because binary
ports are also textual.
There is a failing test due to a scm_from_utf8_stringn bug brought out
by the iconv test that will be fixed in the next commit.
Conflicts:
libguile/deprecated.h
module/ice-9/deprecated.scm
* module/ice-9/iconv.scm (call-with-encoded-output-string):
(string->bytevector, bytevector->string): Take an optional instead of
a keyword argument.
* doc/ref/api-data.texi (Representing Strings as Bytes): Adapt docs to
change, and fix a number of errors. Thanks to Ludovic Courtès for the
pointers.
* test-suite/tests/iconv.test ("wide non-ascii string"): Add a test for
the 'substitute path.
* module/web/client.scm (ensure-uri): New helper.
(open-socket-for-uri): Accept a URI as a string or as a URI object.
(extend-request, sanitize-request): New helpers, like the
corresponding functions in (web server).
(decode-response-body): Add a reference to the HTTP/1.1 spec, and
use (ice-9 iconv).
(request): New helper, factoring all aspects of sending an HTTP
request and getting a response.
(http-get): Redefine in terms of http-get. Deprecate the
#:extra-headers argument in favor of #:headers. Allow a body. Add a
#:streaming? argument, subsuming the functionality of http-get*.
(http-get*): Deprecate.
(http-head, http-post, http-put, http-delete, http-trace)
(http-options): Define interfaces for all HTTP verbs.
* test-suite/tests/web-client.test: Add tests.
* doc/ref/web.texi: Update documentation.
Thanks to Gregory Benison for the initial patch.
* module/web/response.scm (read-response-body): Fix to always return
either a bytevector or #f. Previously, reading a 0-length body could
return the EOF object.