Re: [PATCH] Improved string writing

2005-06-09 Thread Marius Vollmer
[EMAIL PROTECTED] (Ludovic Courtès) writes: > Marius Vollmer <[EMAIL PROTECTED]> writes: > >> Here is a patch for what I have in mind. I have applied it already. > > Just a note: it seems that the line > >> + data = scm_i_string_chars (exp); > > appears twice within the loop but

Re: [PATCH] Improved string writing

2005-06-07 Thread Ludovic Courtès
Marius Vollmer <[EMAIL PROTECTED]> writes: > Here is a patch for what I have in mind. I have applied it already. Just a note: it seems that the line > + data = scm_i_string_chars (exp); appears twice within the loop but is not needed. Thanks, Ludovic. _

Re: [PATCH] Improved string writing

2005-06-06 Thread Marius Vollmer
[EMAIL PROTECTED] (Ludovic Courtès) writes: >> I like this variant best. I don't think that writing strings with >> lots of escape sequences to an unbuffered port happens often enough to >> justify implementing a second buffering mechanism. >> >> When outputting an escaped char, we can additional

Re: [PATCH] Improved string writing

2005-06-06 Thread Marius Vollmer
Marius Vollmer <[EMAIL PROTECTED]> writes: > I will make that change myself in the next days, but if anyone beats > me to it... Here is a patch for what I have in mind. I have applied it already. Index: libguile/print.c === RCS fil

Re: [PATCH] Improved string writing

2005-05-26 Thread Ludovic Courtès
Hi, Marius Vollmer <[EMAIL PROTECTED]> writes: > Kevin Ryde <[EMAIL PROTECTED]> writes: > >> (I notice "write" style string output in iprin1() always goes >> char-by-char, it'd be nice if it scanned ahead for a char needing an >> escape, to send the non-escape block as a single lfwrite. Decent s

Re: [PATCH] Improved string writing

2005-05-24 Thread Marius Vollmer
Kevin Ryde <[EMAIL PROTECTED]> writes: > (I notice "write" style string output in iprin1() always goes > char-by-char, it'd be nice if it scanned ahead for a char needing an > escape, to send the non-escape block as a single lfwrite. Decent size > runs of plain chars are probably quite likely.)

Re: [PATCH] Improved string writing

2005-05-02 Thread Ludovic Courtès
Hi, Kevin Ryde <[EMAIL PROTECTED]> writes: > I expanded the words about the standard ports a bit, for a start: Maybe there should be pointers to `setvbuf' as well? Still, I don't think this makes the changes I proposed earlier in this thread irrelevant. :-) Thanks, Ludovic.

Re: [PATCH] Improved string writing

2005-05-01 Thread Kevin Ryde
I expanded the words about the standard ports a bit, for a start: -- Scheme Procedure: current-input-port -- C Function: scm_current_input_port () Return the current input port. This is the default port used by many input procedures. Initially this is the "standard input" in Un

Re: [PATCH] Improved string writing

2005-04-22 Thread Ludovic Courtès
Hi, Kevin Ryde <[EMAIL PROTECTED]> writes: > (I notice "write" style string output in iprin1() always goes > char-by-char, it'd be nice if it scanned ahead for a char needing an > escape, to send the non-escape block as a single lfwrite. Decent size > runs of plain chars are probably quite likel

Re: [PATCH] Improved string writing

2005-04-21 Thread Kevin Ryde
[EMAIL PROTECTED] (Paul Jarc) writes: > > But the output can be immediate without splitting it up into multiple > system calls. (display "foo") can result in write(1, "foo", 3), and > as long as that write is done before (display) returns, it's still > just as immediate. Yep, that's the sort of c

Re: [PATCH] Improved string writing

2005-04-21 Thread Paul Jarc
Kevin Ryde <[EMAIL PROTECTED]> wrote: > Alas I think that'd be an incompatible change, programs printing a > prompt or progress info probably depend on immediate output as the > default. But the output can be immediate without splitting it up into multiple system calls. (display "foo") can result

Re: [PATCH] Improved string writing

2005-04-21 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: > > Actually, I hadn't considered using it because `stdout' is line-buffered > by default, at least on GNU/Linux Guile doesn't actually use stdio. > (SUSv2 states that it shall be "fully-buffered" by default [1, 2]). Fully buffered on a non-tty. On a

Re: [PATCH] Improved string writing

2005-04-21 Thread Ludovic Courtès
Hi, Kevin Ryde <[EMAIL PROTECTED]> writes: > What happened to the port buffering? Indeed, it occurred to me that this is easily fixed by making the port line-buffered with `setvbuf'... Actually, I hadn't considered using it because `stdout' is line-buffered by default, at least on GNU/Linux (SU

Re: [PATCH] Improved string writing

2005-04-20 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: > > While running Guile 1.7.2 under `strace', I noticed the following > unpleasant thing: What happened to the port buffering? > The patch below adds buffering in `iprin1' (print.c) That doesn't sound like a good place. > Note that `format' in (ice-9

[PATCH] Improved string writing

2005-04-20 Thread Ludovic Courtès
Hi, While running Guile 1.7.2 under `strace', I noticed the following unpleasant thing: write(1, "\"", 1) = 1 write(1, "h", 1)= 1 write(1, "e", 1)= 1 write(1, "l", 1)= 1 write(1, "l", 1)