guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-25-g99


From: Ludovic Courtès
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
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

"Andy Wingo" <address@hidden> skribis:

> commit f05bb8494c9636cd7a44aaf7d4e08f4b66004b6e
> Author: Andy Wingo <address@hidden>
> Date:   Thu Jan 10 22:50:27 2013 +0100
>
>     add bytevector->string and string->bytevector in new (ice-9 iconv) module
>     
>     * module/Makefile.am:
>     * module/ice-9/iconv.scm: New module implementing procedures to encode
>       and decode representations of strings as bytes.
>     
>     * test-suite/Makefile.am:
>     * test-suite/tests/iconv.test: Add tests.
>     
>     * doc/ref/api-data.texi: Add docs.

Nice, this was long overdue, I guess.  :-)

> address@hidden Representing Strings as Bytes
> address@hidden Representing Strings as Bytes

[...]

> address@hidden string->bytevector string encoding 
> [#:conversion-strategy='error]

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
> address@hidden string.  If the string has characters that cannot be
> +represented in the encoding, by default this procedure raises an
> address@hidden,

I think this doesn’t 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 ‘test-decoding-error’ in ports.test.)

> address@hidden bytevector->string bytevector encoding 

#: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’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]