From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Daniel Skarda <0rfelyus@ucw.cz> Newsgroups: gmane.lisp.guile.devel Subject: Bug in soft ports Date: Mon, 30 Dec 2002 01:09:43 +0100 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1041234743 6063 80.91.224.249 (30 Dec 2002 07:52:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 30 Dec 2002 07:52:23 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Suii-0001Zd-00 for ; Mon, 30 Dec 2002 08:52:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18SujB-0004bf-09 for guile-devel@m.gmane.org; Mon, 30 Dec 2002 02:52:49 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18Suim-0004ay-00 for guile-devel@gnu.org; Mon, 30 Dec 2002 02:52:24 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18Suij-0004W2-00 for guile-devel@gnu.org; Mon, 30 Dec 2002 02:52:23 -0500 Original-Received: from stateless2.tiscali.cz ([213.235.135.71] helo=mail.tiscali.cz) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Suii-0004Ss-00 for guile-devel@gnu.org; Mon, 30 Dec 2002 02:52:20 -0500 Original-Received: from hobitin.ucw.cz (212.11.106.144) by mail.tiscali.cz (6.0.044) id 3DDE8B9E00587C4A for guile-devel@gnu.org; Mon, 30 Dec 2002 08:50:09 +0100 Original-Received: from 0rfelyus by hobitin.ucw.cz with local (Exim 3.36 #1 (Debian)) id 18SnV1-0000vm-00 for ; Mon, 30 Dec 2002 01:09:43 +0100 Original-To: guile-devel@gnu.org User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/20.7 (i386-debian-linux-gnu) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:1845 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1845 Hello, today I tried soft ports (as an experiment I wrote a soft port which indents output - (make-indent-port port start-column max-column) creates something like indenting pipe :-) During development of my enhanced port I hit a barrier - I think I found a bug in soft ports. Even thought I (force-output my-port), sometimes I have not got any output. Let's examine function sf_flush from vports.c: static void sf_flush (SCM port) { scm_t_port *pt = SCM_PTAB_ENTRY (port); SCM stream = SCM_PACK (pt->stream); if (pt->write_pos > pt->write_buf) { /* write the byte. */ scm_call_1 (SCM_VELTS (stream)[0], SCM_MAKE_CHAR (*pt->write_buf)); pt->write_pos = pt->write_buf; /* flush the output. */ { SCM f = SCM_VELTS (stream)[2]; if (!SCM_FALSEP (f)) scm_call_0 (f); } } } When the write buffer is empty, soft port never calls flush function. In my opinion scm_call_0 should be called _before_ first "if", because (at least in my code) flush can create some output and write to buffer. Does anybody remember any reason for current strange behaviour of soft ports during flush? 0. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel