From: Andreas Rottmann <a.rottmann@gmx.at>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: [PATCH 2/4] Add implementation of "transcoded ports"
Date: Sun, 21 Nov 2010 23:07:11 +0100 [thread overview]
Message-ID: <87d3pyz5yo.fsf@delenn.lan> (raw)
In-Reply-To: <87r5efsj42.fsf@gnu.org> ("Ludovic Courtès"'s message of "Sat, 20 Nov 2010 23:52:45 +0100")
ludo@gnu.org (Ludovic Courtès) writes:
> Hi!
>
> Andreas Rottmann <a.rottmann@gmx.at> writes:
>
>> * libguile/r6rs-ports.c (make_tp, tp_write, tp_fill_input, tp_flush,
>> tp_close, initialize_transcoded_ports, scm_transcoded_port): New
>> functions.
>> (scm_init_r6rs_ports): Call `initialize_transcoded_ports'.
>> * module/rnrs/ports.scm (transcoded-port): Remove, this is now
>> implemented in C.
>> * test-suite/tests/r6rs-ports.test (8.2.6 Input and output ports): Added a
>> few tests for `transcoded-port'.
>
> Great! This looks good to me, modulo the minor things below:
>
>> + /* We can't use scm_c_read() here, since it blocks until the whole
>> + block has been read or EOF */
>
> Please write it “`scm_c_read'” and add a period at the end.
>
Done.
>> +SCM_DEFINE (scm_transcoded_port,
>> + "transcoded-port", 2, 0, 0,
>> + (SCM port, SCM transcoder),
>> + "")
>
> Docstring please. :-)
>
Added.
>> + SCM_VALIDATE_STRUCT (SCM_ARG1, transcoder);
>
> This type check is too weak.
>
I've restructured the code now so the type checking is done (implictly)
in Scheme.
>> + /* SCM_CLR_PORT_OPEN_FLAG (port); */
>
> Meaning of this comment?
>
I've replaced it with a (hopefully) more meaningful comment.
>> +(with-test-prefix "8.2.6 Input and output ports"
>> + (pass-if "transcoded-port [output]"
>> + (let ((s "Hello\n\304\326\334"))
>
> It seems that it’s not actual UTF-8, or maybe the message mangled it
> somehow?
>
The file has a header which contains this: "coding: iso-8859-1;". The
strings in the source should hence (IIUC) be in latin-1 encoding -- at
least that's what they are in my git.
>> + (call-with-port (transcoded-port bv-port (make-transcoder (utf-8-codec)))
>
> I think you forgot the patch that adds ‘make-transcoder’ and
> ‘utf-8-codec’. :-)
>
As I split the patch into the series, I obviously got the ordering
wrong; sorry. The "transcoded-port" patch is now the last in the
series.
> Can you send an updated patch (or pair of patches)?
>
I'll send the updated series as follow-up to this mail.
Regards, Rotty
--
Andreas Rottmann -- <http://rotty.yi.org/>
next prev parent reply other threads:[~2010-11-21 22:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-15 21:45 Some work on the R6RS I/O libraries Andreas Rottmann
2010-11-19 23:59 ` Ludovic Courtès
2010-11-20 17:40 ` [PATCH 1/4] Fix missing port-table locking and bytevector output port segfault Andreas Rottmann
2010-11-20 22:43 ` Ludovic Courtès
2010-11-20 17:40 ` [PATCH 2/4] Add implementation of "transcoded ports" Andreas Rottmann
2010-11-20 22:52 ` Ludovic Courtès
2010-11-21 22:07 ` Andreas Rottmann [this message]
2010-11-21 22:17 ` [PATCH 1/4] Turn `(rnrs io ports)' into an R6RS library Andreas Rottmann
2010-11-21 22:17 ` [PATCH 2/4] Reorganize the R6RS I/O condition types Andreas Rottmann
2010-11-21 22:17 ` [PATCH 3/4] Work towards a more complete implementation of `(rnrs io ports)' Andreas Rottmann
2010-11-23 21:13 ` Ludovic Courtès
2010-11-23 23:44 ` Andreas Rottmann
2010-11-24 20:24 ` Ludovic Courtès
2010-11-21 22:17 ` [PATCH 4/4] Add implementation of "transcoded ports" Andreas Rottmann
2010-11-24 22:29 ` Ludovic Courtès
2010-11-25 0:08 ` Andreas Rottmann
2010-11-25 21:15 ` Ludovic Courtès
2010-11-20 17:40 ` [PATCH 3/4] Reorganize the R6RS I/O condition types Andreas Rottmann
2010-11-20 17:40 ` [PATCH 4/4] Work towards a more complete implementation of `(rnrs io ports)' Andreas Rottmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d3pyz5yo.fsf@delenn.lan \
--to=a.rottmann@gmx.at \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).