unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: Ian Price <ianprice90@googlemail.com>, 10616@debbugs.gnu.org
Subject: bug#10616: flush procedure for soft ports isn't called
Date: Sat, 10 Mar 2012 23:14:39 +0100	[thread overview]
Message-ID: <87399gaysw.fsf@gnu.org> (raw)
In-Reply-To: <87linbt83w.fsf@netris.org> (Mark H. Weaver's message of "Thu, 08 Mar 2012 10:39:31 -0500")

Hi Mark,

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Ian Price <ianprice90@googlemail.com> skribis:
>>
>>>  
>>> -  if (pt->write_pos > pt->write_buf)
>>> -    {
>>> -      /* write the byte. */
>>> -      scm_call_1 (SCM_SIMPLE_VECTOR_REF (stream, 0),
>>> -		  SCM_MAKE_CHAR (*pt->write_buf));
>>> -      pt->write_pos = pt->write_buf;
>>> -  
>>> -      /* flush the output.  */
>>> -      {
>>> -	SCM f = SCM_SIMPLE_VECTOR_REF (stream, 2);
>>> +  SCM f = SCM_SIMPLE_VECTOR_REF (stream, 2);
>>> +
>>> +  if (scm_is_true (f))
>>> +    scm_call_0 (f);
>>>  
>>> -	if (scm_is_true (f))
>>> -	  scm_call_0 (f);
>>> -      }
>>> -    }
>>>  }
>>
>> It’s a bit late to reply (sorry, Ian!), but the reason it took me so
>> long, is that I wanted to understand the rationale for the ‘if’, and the
>> implications of dropping it (which I never got around to, as you can
>> see.  ;-))
>>
>> Mark: what’s your take on this?  I’m especially concerned with
>> undesirable side effects in user code.
>
> I searched libguile for occurrences of 'write_pos' and 'write_buf', and
> convinced myself that Ian's analysis was indeed correct.  The write
> buffer is not used by the core ports code.  Writes are forwarded
> directly to the write function of the specific port type, which may use
> the write buffer if it wishes to, but need not.  The write buffer is
> used only by certain types of ports: currently string ports and file
> ports.  It is not used by soft ports.

OK.  Thanks for the detailed analysis!

Ludo’.





      reply	other threads:[~2012-03-10 22:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-26 22:10 bug#10616: flush procedure for soft ports isn't called Ian Price
2012-01-27  5:44 ` Ian Price
2012-01-27  6:27   ` Ian Price
2012-01-27  6:44     ` Ian Price
2012-01-27 20:36       ` Ludovic Courtès
2012-01-27 20:51         ` Ian Price
2012-03-08  5:06           ` Mark H Weaver
2012-03-08 13:53           ` Ludovic Courtès
2012-03-08 15:39             ` Mark H Weaver
2012-03-10 22:14               ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87399gaysw.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=10616@debbugs.gnu.org \
    --cc=ianprice90@googlemail.com \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).