From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-25-g990b11c Date: Fri, 11 Jan 2013 18:15:52 +0100 Message-ID: <87k3rj3ak7.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1357924571 5822 80.91.229.3 (11 Jan 2013 17:16:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Jan 2013 17:16:11 +0000 (UTC) Cc: guile-devel@gnu.org To: "Andy Wingo" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 11 18:16:28 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TtiDT-0005TU-SS for guile-devel@m.gmane.org; Fri, 11 Jan 2013 18:16:27 +0100 Original-Received: from localhost ([::1]:53964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtiDB-0006c0-H8 for guile-devel@m.gmane.org; Fri, 11 Jan 2013 12:16:09 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtiD4-0006bR-EY for guile-devel@gnu.org; Fri, 11 Jan 2013 12:16:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtiCy-0004KN-4g for guile-devel@gnu.org; Fri, 11 Jan 2013 12:16:01 -0500 Original-Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:13118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtiCx-0004KF-Tj for guile-devel@gnu.org; Fri, 11 Jan 2013 12:15:56 -0500 X-IronPort-AV: E=Sophos;i="4.84,453,1355094000"; d="scan'208";a="189532961" Original-Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 11 Jan 2013 18:15:53 +0100 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 22 =?utf-8?Q?Niv=C3=B4se?= an 221 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: (Andy Wingo's message of "Fri, 11 Jan 2013 14:40:18 +0000") User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.82 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15385 Archived-At: "Andy Wingo" skribis: > commit f05bb8494c9636cd7a44aaf7d4e08f4b66004b6e > Author: Andy Wingo > Date: Thu Jan 10 22:50:27 2013 +0100 > > add bytevector->string and string->bytevector in new (ice-9 iconv) mo= dule >=20=20=20=20=20 > * module/Makefile.am: > * module/ice-9/iconv.scm: New module implementing procedures to encode > and decode representations of strings as bytes. >=20=20=20=20=20 > * test-suite/Makefile.am: > * test-suite/tests/iconv.test: Add tests. >=20=20=20=20=20 > * doc/ref/api-data.texi: Add docs. Nice, this was long overdue, I guess. :-) > +@node Representing Strings as Bytes > +@subsubsection Representing Strings as Bytes [...] > +@deffn string->bytevector string encoding [#:conversion-strategy=3D'erro= r] An optional instead of keyword argument would look nicer, IMO. > +Encode @var{string} as a sequence of bytes. > + > +The string will be encoded in the character set specified by the > +@var{encoding} string. If the string has characters that cannot be > +represented in the encoding, by default this procedure raises an > +@code{encoding-error}, I think this doesn=E2=80=99t leave a way to know which character in STRING = could not be converted. It would be ideal if that information could be provided as part of the exception, as is the case with ports (tested with =E2=80=98test-decoding-error=E2=80=99 in ports.test.) > +@deffn bytevector->string bytevector encoding=20 #:conversion-strategy is missing here. > +The Scheme interface to this function is @code{encode-string}, from the string->bytevector > +The Scheme interface to this function is @code{decode-string}. bytevector->string > +(define-module (ice-9 iconv) > + #:use-module (rnrs bytevectors) > + #:use-module (ice-9 binary-ports) > + #:use-module ((ice-9 rdelim) #:select (read-delimited)) > + #:export (string->bytevector > + bytevector->string > + call-with-encoded-output-string)) Not a single docstring. Now I feel ashamed when asking Nala to add docstrings. ;-) Thanks! Ludo=E2=80=99.