Re: [Rd] Spurious output white line in R script (PR#8631)

From: Simon Urbanek <simon.urbanek_at_r-project.org>
Date: Thu 23 Feb 2006 - 17:20:48 GMT

On Feb 23, 2006, at 11:14 AM, Thomas Lumley wrote:

> On Thu, 23 Feb 2006, Prof Brian Ripley wrote:
>
>> On Wed, 22 Feb 2006, Franšois Pinard wrote:
> [...]
>>> So, I was not expecting R, running with that option activated, to
>>> "volunteer" white lines. :-)
>>
>> But Simon said `with the documentation'. Not doing what you
>> expected is
>> not a bug. Can you please point us to documentation which says that
>> end-of-file produces no output?
>>
>> This does appear to be deliberate behaviour from
>>
>> void end_Rmainloop(void)
>> {
>> Rprintf("\n");
>> /* run the .Last function. If it gives an error, will drop back
>> to main
>> loop. */
>> R_CleanUp(SA_DEFAULT, 0, 1);
>> }
>>
>> and I think it is necessary, as R might well have a partial line
>> of output queued up for the console. So this is probably `as
>> quietly as possible'.
>
> (While agreeing entirely on the "bug" issue), couldn't we have
> fflush() instead of sending a newline?
>

It's not really about fflush - the rationale is to not leave non- terminated lines on the output before quitting via EOF, which has its merits. If you remove it, you get this:
...
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

 > caladan:Rdev$

instead of

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

 >
caladan:Rdev$

fflush won't change this.

Cheers,
Simon



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Feb 24 06:25:06 2006

This archive was generated by hypermail 2.1.8 : Thu 23 Feb 2006 - 22:16:07 GMT