From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Doug Evans Newsgroups: gmane.lisp.guile.devel Subject: Re: port-with-print-state doesn't create a port? Or, when is a port not a port? :-) Date: Sun, 25 May 2014 12:05:19 -0700 Message-ID: References: <87fvk3mcpo.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1401044738 30846 80.91.229.3 (25 May 2014 19:05:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 May 2014 19:05:38 +0000 (UTC) Cc: guile-devel To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun May 25 21:05:31 2014 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wodjf-0003eT-2l for guile-devel@m.gmane.org; Sun, 25 May 2014 21:05:31 +0200 Original-Received: from localhost ([::1]:52688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wodje-0005bx-Bg for guile-devel@m.gmane.org; Sun, 25 May 2014 15:05:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WodjZ-0005bG-IE for guile-devel@gnu.org; Sun, 25 May 2014 15:05:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WodjU-0003Ow-3r for guile-devel@gnu.org; Sun, 25 May 2014 15:05:25 -0400 Original-Received: from mail-yh0-x233.google.com ([2607:f8b0:4002:c01::233]:37498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WodjU-0003Od-07; Sun, 25 May 2014 15:05:20 -0400 Original-Received: by mail-yh0-f51.google.com with SMTP id f73so5796002yha.38 for ; Sun, 25 May 2014 12:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=n9nVCR4G55hMBJ2Q0eB0anYGePvTCLQpTHn4S9wA2ro=; b=03DZh9vAw/f3V3oSCnHjBRh6ORub4M5VZ3cDM8H1RrYiLbiZgPKWFg0QnuPKGGev9O OKrAJSw0gd7b894qlAhus2Brq01DKl4cycBFlu0CZ9I5AG3ABTsuFDTVqC96it4k7aaX 7VKNfcGq+8tHwKZtBxZCJCqbO5kH/2Zbxn+5jBxyOJ9/SYELn80zEaa51OCpldTk8G6p 5lpa0FcHFLu06gUy0gDYNcVjNMqmANAK34QGzWmMDlOJrQQyA8BlAUnU9hrmKQgpdP2R gGIbxYLZDFxefGM6YX+DuUIP3sSqJak10KJmEikG+GEJOz2pXwF/SCpBzANFukz7rOp9 fnbg== X-Received: by 10.236.93.195 with SMTP id l43mr29819752yhf.40.1401044719307; Sun, 25 May 2014 12:05:19 -0700 (PDT) Original-Received: by 10.170.150.70 with HTTP; Sun, 25 May 2014 12:05:19 -0700 (PDT) In-Reply-To: <87fvk3mcpo.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c01::233 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:17159 Archived-At: On Wed, May 21, 2014 at 7:24 AM, Ludovic Court=C3=A8s wrote: > Hi! > > Doug Evans skribis: > >> The problem can be succinctly represented by the following: >> >> scheme@(guile-user)> (port? (port-with-print-state (current-output-port)= )) >> $3 =3D #f > > I think the short answer is that it=E2=80=99s a very old API that=E2=80= =99s essentially > unused internally. For instance, make check passes with this patch: > > > > I think the problem it was trying to solve has been solved differently > (by explicitly passing the print state in the print.c code, for > instance), and can easily be solved differently. > >> In the meantime, I can make struct printers be aware of the >> distinction and handle being passed port-with-print-state ports. > > Do you actually need this associated state? Nope. The point of my message is that if a struct printer written in C blindly calls scm_puts ... boom. That, plus it's a bit odd that port-with-print-state doesn't create something that satisfies port?. > My first feeling is that we should deprecate and eventually remove this > API, given that it=E2=80=99s essentially unused and non-functional. > > What do people think? > >> P.S. How come scm_put[cs]_unlocked are inlined in ports.h? > > What=E2=80=99s wrong with that? (It probably doesn=E2=80=99t help much b= ecause > scm_lfwrite_unlocked isn=E2=80=99t inlined.) AFAICT there can be no measurable speed up from having them there, so their presence is at least odd: The astute reader of the file will ask why they're there, and there is no good answer.