From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: binary-port? Date: Sun, 24 Apr 2011 15:03:01 +0200 Message-ID: <878vuzx0my.fsf@gnu.org> References: <871v0tudjg.fsf@gnu.org> <87sjt9agb5.fsf@gmx.at> <87liz0yc5l.fsf@gnu.org> <87bozwdufz.fsf@rapitore.luna> 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 1303650192 22271 80.91.229.12 (24 Apr 2011 13:03:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 24 Apr 2011 13:03:12 +0000 (UTC) Cc: guile-devel@gnu.org To: Marco Maggi Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Apr 24 15:03:08 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QDyxw-00028G-Lx for guile-devel@m.gmane.org; Sun, 24 Apr 2011 15:03:08 +0200 Original-Received: from localhost ([::1]:60018 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDyxv-00026h-Bv for guile-devel@m.gmane.org; Sun, 24 Apr 2011 09:03:07 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:59124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDyxt-00026c-3e for guile-devel@gnu.org; Sun, 24 Apr 2011 09:03:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QDyxr-0002hy-RB for guile-devel@gnu.org; Sun, 24 Apr 2011 09:03:05 -0400 Original-Received: from solo.fdn.fr ([80.67.169.19]:57626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDyxr-0002hu-Ll for guile-devel@gnu.org; Sun, 24 Apr 2011 09:03:03 -0400 Original-Received: from nixey (reverse-83.fdn.fr [80.67.176.83]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) (Authenticated sender: lcourtes) by smtp.fdn.fr (Postfix) with ESMTPSA id 6316644471; Sun, 24 Apr 2011 15:03:02 +0200 (CEST) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 5 =?iso-8859-1?Q?Flor=E9al?= an 219 de la =?iso-8859-1?Q?R=E9volution?= 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: <87bozwdufz.fsf@rapitore.luna> (Marco Maggi's message of "Sun, 24 Apr 2011 08:39:28 +0200") User-Agent: Gnus/5.110015 (No Gnus v0.15) Emacs/23.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 80.67.169.19 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:12327 Archived-At: Hi Marco, Marco Maggi writes: > Ludovic Court=C3=A8s wrote: > >>>> However, I=E2=80=99m wondering whether we should not just >>>> squarely do away with the binary/textual distinction > > How would you handle port position? Currently port position is in bytes for all kinds of ports (info "(guile) Random Access"). It seems to be a valid implementation of R6 port positions, no? [...] > IMHO this R6 statement: > > (textual-port? port) procedure=20 > (binary-port? port) procedure=20 > > The textual-port? procedure returns #t if port is > textual, and returns #f otherwise. The binary-port? > procedure returns #t if port is binary, and returns #f > otherwise. > > should be enough to derive that: > > (cond ((binary-port? p) > ---) > ((textual-port? p) > ---)) > > and: > > (cond ((textual-port? p) > ---) > ((binary-port? p) > ---)) > > must be equivalent; if they are not, confusion arises > because of violation of the rule of least surprise. Yes, and that=E2=80=99s a problem. OTOH, what I wonder is when in practice would you need to use such an idiom, or to use these predicates at all? Thanks, Ludo=E2=80=99.