From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.devel Subject: Re: `mike-port-encodings' branch (bug #29643) Date: Thu, 10 Jun 2010 11:16:13 -0700 (PDT) Message-ID: <604202.69520.qm@web37905.mail.mud.yahoo.com> References: <87typdyx8o.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 1276194297 29392 80.91.229.12 (10 Jun 2010 18:24:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 10 Jun 2010 18:24:57 +0000 (UTC) Cc: guile-devel@gnu.org To: =?utf-8?B?THVkb3ZpYyBDb3VydMOocw==?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jun 10 20:24:56 2010 connect(): No such file or directory 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 1OMmQw-0006dF-P2 for guile-devel@m.gmane.org; Thu, 10 Jun 2010 20:24:55 +0200 Original-Received: from localhost ([127.0.0.1]:36816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMmQu-0003uL-LT for guile-devel@m.gmane.org; Thu, 10 Jun 2010 14:24:52 -0400 Original-Received: from [140.186.70.92] (port=35968 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMmIb-0007sC-Ki for guile-devel@gnu.org; Thu, 10 Jun 2010 14:16:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMmIa-00005Y-HN for guile-devel@gnu.org; Thu, 10 Jun 2010 14:16:17 -0400 Original-Received: from web37905.mail.mud.yahoo.com ([209.191.91.167]:41865) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OMmIa-00004v-Ag for guile-devel@gnu.org; Thu, 10 Jun 2010 14:16:16 -0400 Original-Received: (qmail 70098 invoked by uid 60001); 10 Jun 2010 18:16:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1276193773; bh=Nf56HFbJGBq9SMZIIIYmn+EKiskalRrYM4NK0eWh91w=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=SvRbttpRGTU+MxTSJHeMLnNfyKEHmAiv+44D9mK+ji1HndgByHC5jJcuv7SRYqnp4dKjIMj623oCVhi/6cS19Uzhp4YB0OKABx/YoDz+CK1iIW7bTlgzPdwsOLQf7lD0L0RB1i7H1bt2Un1IxTxG8fsE0Bobp6YPoXeSqv6bMrY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Ok6CQFMDKjOh38McOQCu9BfDjrGjISI2iepDWU+V5T3PEz6J5GsTQYgWyR7AvFmEHqsAvPzkOSGP8RkjnsassCQdLDElr8wHpoXQVxNf/rJ8A5gujMlvMWQadA6zCWVh8QEyOieOKGhk6ynvQV6Sed6YfH4JAQsQCaMTC+ouMlg=; X-YMail-OSG: erPbbYcVM1mjkdCXM8fNlOeNQ4lskK1v2NdQoUHrCXvsYcq uoDDDC4Cr4eAzy_TlIttdAsXaS2ESIReKniz9h8BT1yrmkwyeFC39d2m6SGf JZY4losTo640C3sqfQONoTtlrLF4X2RaguInipRfSfny.eRW1QvjL.yH.tQh 2uq7mSlAKUqGN8YW8645qWEfqtqK09LzV1Z8rXl4u4hgJUv1fupqaCtz9IhD t1_8Sw6SIQE7viBqgjJ48unpNnrukLHFD2Hs3ooTgzi2ZSp3HLC5wyPvZ7Ui zz7J0s8Lip.LbsEj9DR_w8YBULIITcWm22nSDZ8E20rgwDJ_8U7rvSLJDmb2 9H1mb9bX2 Original-Received: from [209.203.10.194] by web37905.mail.mud.yahoo.com via HTTP; Thu, 10 Jun 2010 11:16:13 PDT X-Mailer: YahooMailRC/397.8 YahooMailWebService/0.8.103.269680 In-Reply-To: <87typdyx8o.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: FreeBSD 6.x (1) 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:10460 Archived-At: > From: Ludovic Court=C3=A8s =0A> Hello Mike,=0A=0A> Thanks f= or working on this!=0A=0A> Here=E2=80=99s a review of the =E2=80=98mike-por= t-encodings=E2=80=99 branch.=0A=0A=0A> Hmm, =E2=80=9Csimplification=E2=80= =9D?=C2=A0 :-)=0A=0A> Is this commit really needed?=C2=A0 What=E2=80=99s th= e operational effect?=0A=0AThat commit has no net effect; however, the code= =0Auses the 'i' variable in a for loop as an iterator and then=0Auses its v= alue after the loop.=C2=A0 Using a for loop iterator=0Avariable after the l= oop is complete is bad style, IMHO.=0A=0A> OK.=C2=A0 Would it be possible t= o write a test case, =0A> perhaps with a string port?=0A=0ASure.=0A=0A>>=C2= =A0 +Returns, as a string, the character encoding that =0A>> @var{port} use= s to interpret=0A>>=C2=A0 +its input and output.=C2=A0 The value @code{#f} = is equivalent to =0A>> @code{"ISO-8859-1"}.=0A=0A> Instead of having the #f= special case, I=E2=80=99ve been =0A> thinking that it would be nicer and e= asier to have =E2=80=98port-encoding=E2=80=99 always =0A> return a string (= similar for =E2=80=98set-port-encoding!=E2=80=99), which would be =0A> "ISO= -8859-1" instead of #f.=C2=A0 Perhaps it=E2=80=99s a bit late, =0A> though.= =0A=0A> What do you think?=0A=0AI have no problem with that.=C2=A0 But, the= re is some small optimization that=0Acomes from using NULL and SCM_BOOL_F a= s shorthand for ISO-8859-1,=0Abecause is eliminates a strcmp operation befo= re each block of port text=0Ais read or written.=0A=0A[...]=0A=0A> I dislik= e this whole notion of =E2=80=9Cbinary-compatibility=E2=80=9D.=C2=A0 What i= s meant=0A> here is that for binary I/O, =0A> you=E2=80=99d better choose I= SO-8859-1 as theport=E2=80=99s encoding because non-ASCII byte =0A> values = will go through as is,right?=C2=A0 (I suppose that=E2=80=99s true of any = =0A> 8-bit encoding.)=0A=0AIn the documentation, (rnrs io ports) could be r= ecommended for binary=0Aports.=C2=A0 No problem.=0A=0ABut do you agree with= the idea that Guile should=C2=A0force 8-bit encoding when=0Aa legacy binar= y port is opened?=C2=A0 Or should it still inherit %default-port-encoding?= =0AWhich if those does not violate the 'principle of least surprise'?=0A=0A= -Mike