From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH 2/4] Add implementation of "transcoded ports" Date: Sun, 21 Nov 2010 23:07:11 +0100 Message-ID: <87d3pyz5yo.fsf@delenn.lan> References: <87ipzsvp9y.fsf@gnu.org> <1290274833-24970-2-git-send-email-a.rottmann@gmx.at> <87r5efsj42.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1290377256 25341 80.91.229.12 (21 Nov 2010 22:07:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 21 Nov 2010 22:07:36 +0000 (UTC) Cc: guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Nov 21 23:07:27 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PKI4F-0005oW-0p for guile-devel@m.gmane.org; Sun, 21 Nov 2010 23:07:27 +0100 Original-Received: from localhost ([127.0.0.1]:60863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKI4E-0007dC-9c for guile-devel@m.gmane.org; Sun, 21 Nov 2010 17:07:26 -0500 Original-Received: from [140.186.70.92] (port=54158 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKI4A-0007cn-Kr for guile-devel@gnu.org; Sun, 21 Nov 2010 17:07:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PKI47-0005CV-QR for guile-devel@gnu.org; Sun, 21 Nov 2010 17:07:22 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:35993 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PKI47-0005Bo-FS for guile-devel@gnu.org; Sun, 21 Nov 2010 17:07:19 -0500 Original-Received: (qmail invoked by alias); 21 Nov 2010 22:07:17 -0000 Original-Received: from 83-215-154-5.hage.dyn.salzburg-online.at (EHLO nathot.lan) [83.215.154.5] by mail.gmx.net (mp067) with SMTP; 21 Nov 2010 23:07:17 +0100 X-Authenticated: #3102804 X-Provags-ID: V01U2FsdGVkX18dyqEQuBodVolwdLzFkns3ZOgn3phgszT+pZmyRj byOJMrlao1iH+r Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by nathot.lan (Postfix) with ESMTP id 4B1853A695; Sun, 21 Nov 2010 23:07:16 +0100 (CET) Original-Received: from nathot.lan ([127.0.0.1]) by localhost (nathot.lan [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7E5efSbgSXSF; Sun, 21 Nov 2010 23:07:11 +0100 (CET) Original-Received: from delenn.lan (delenn.lan [192.168.3.11]) by nathot.lan (Postfix) with ESMTP id D188C3A693; Sun, 21 Nov 2010 23:07:11 +0100 (CET) Original-Received: by delenn.lan (Postfix, from userid 1000) id 7F1332C029C; Sun, 21 Nov 2010 23:07:11 +0100 (CET) In-Reply-To: <87r5efsj42.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sat, 20 Nov 2010 23:52:45 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11181 Archived-At: ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi! > > Andreas Rottmann 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 =E2=80=9C`scm_c_read'=E2=80=9D and add a period at the en= d. > 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=E2=80=99s 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 (u= tf-8-codec))) > > I think you forgot the patch that adds =E2=80=98make-transcoder=E2=80=99 = and > =E2=80=98utf-8-codec=E2=80=99. :-) > 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 --=20 Andreas Rottmann --