From tlumley at u.washington.edu  Thu Feb 23 19:28:15 2006
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Thu, 23 Feb 2006 10:28:15 -0800 (PST)
Subject: [Rd] Spurious output white line in R script (PR#8631)
In-Reply-To: <E02C3C2E-38B3-4FEF-B90A-8DBA4FF09939@r-project.org>
References: <20060222184113.A6F1B3F70C@slim.kubism.ku.dk>
	<20A69DDC-E571-4DD1-9047-0073F47FA7CF@r-project.org>
	<20060222231022.GA24313@phenix.sram.qc.ca>
	<Pine.LNX.4.64.0602230552410.24547@gannet.stats.ox.ac.uk>
	<Pine.LNX.4.64.0602230809280.23263@homer21.u.washington.edu>
	<E02C3C2E-38B3-4FEF-B90A-8DBA4FF09939@r-project.org>
Message-ID: <Pine.LNX.4.64.0602231026070.23263@homer21.u.washington.edu>

On Thu, 23 Feb 2006, Simon Urbanek wrote:

>
> 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.

I would have thought that, at least with --slave, you might want the 
ability to produce output that didn't end with any newline (in contrast to 
the original question, which was about one vs two newlines, which is easy 
to fix).

 	-thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle


[Rd] Spurious output white line in R script (PR#8631)
Thomas Lumley