chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Default buffering for output ports


From: felix winkelmann
Subject: Re: [Chicken-users] Default buffering for output ports
Date: Wed, 13 Sep 2006 10:29:55 +0200

On 9/12/06, Alejandro Forero Cuervo <address@hidden> wrote:

Shouldn't the initial output port in Chicken applications
be line-buffered?  I think this is the standard practice in most
programming languages, but it seems not to be the case with Chicken
(I'm using 2.3 in GNU/Linux).

In the specific case of C, at least in GNU/Linux with glibc:

> The stream stderr is unbuffered. The stream stdout is line-buffered
> when it points to a terminal. Partial lines will not appear until
> fflush(3) or exit(3) is called, or a newline is printed.  This can
> produce unexpected results, especially with debugging output.

I think this is standard practice in other programming languages (a
quick check with Perl seems to confirm it behaves the same way).

I know I can just use set-buffering-mode!, but I believe the default
should be to use line-buffering for the default output port and force
programmers to use set-buffering-mode! to #:none if they want the
current behaviour.


Chicken does no buffering by itself, it just uses stdio routines,.
These in turn call fputc() when writing characters or fputs() when
writing strings. Everything else is handled on the C side.


cheers,
felix

--
http://galinha.ucpel.tche.br:8081/blog/blog.ssp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]