From jtk at cmp.uea.ac.uk  Thu Sep  1 14:57:39 2005
From: jtk at cmp.uea.ac.uk (Jan T. Kim)
Date: Thu, 1 Sep 2005 13:57:39 +0100
Subject: [Rd] R CMD BATCH on scripts without trailing newline
In-Reply-To: <17174.59528.327720.694835@stat.math.ethz.ch>
References: <17174.57691.868797.92193@notch.amtp.cam.ac.uk>
	<17174.59528.327720.694835@stat.math.ethz.ch>
Message-ID: <20050901125739.GB5066@jtkpc.cmp.uea.ac.uk>

On Thu, Sep 01, 2005 at 01:39:52PM +0200, Martin Maechler wrote:

>     >> getwd()proc.time()
>     StEgl> Error: syntax error Execution halted $
> 
> aahh, now I finally understand via some people append
> those **ugly** unneeded ';' to the end of almost every line of R
> code.  It would have helped here
> :-) :-)

What is the problem with the semicolons? Ugliness is in the eye of
the beholder, evidently, but on a more objective level, terminating
statements by an explicit and visible separator seems like a very
reasonable idea to me.

>     StEgl> Is it worth changing the BATCH script so that it adds
>     StEgl> a newline before adding the call to proc.time()?
> 
> Yes I think it would be.  This is trivial, at least for 
>  <Rsrc>/src/scripts/BATCH
> Slightly better but more tricky:  only append a newline "when needed".
> Any idea for that?

I think this is a dangerous direction of thought. Having a "terminator
if apparently needed" semantics of newline has already brought us the
inconsistency of if / else parsing inside and outside of blocks. No more
of that, please.

Best regards, Jan
-- 
 +- Jan T. Kim -------------------------------------------------------+
 |    *NEW*    email: jtk at cmp.uea.ac.uk                               |
 |    *NEW*    WWW:   http://www.cmp.uea.ac.uk/people/jtk             |
 *-----=<  hierarchical systems are for files, not for humans  >=-----*



[Rd] R CMD BATCH on scripts without trailing newline
Jan T. Kim