From jtk at cmp.uea.ac.uk  Wed Apr 27 00:46:11 2005
From: jtk at cmp.uea.ac.uk (Jan T. Kim)
Date: Tue Apr 26 23:50:38 2005
Subject: [Rd] Any plans for commenting out region via something like " /*
	*/	"?
In-Reply-To: <426EB122.2010801@jhsph.edu>
References: <1abe3fa905010702034c2e2799@mail.gmail.com>
	<426EB122.2010801@jhsph.edu>
Message-ID: <20050426224611.GD3718@jtkpc.cmp.uea.ac.uk>

On Tue, Apr 26, 2005 at 05:22:42PM -0400, Roger D. Peng wrote:
> I realize this thread is a bit old, but it only just came to my 
> mind.  What about using a function like
> 
> commentOut <- function(expr) { invisible() }
> 
> and then
> 
> commentOut({
> 	a <- 10
> 	bladfkljasdlkfj()
> 	blah blah blah
> })
> 
> Lazy evaluation prevents the expression from being evaluated so 
> you don't have to worry about syntatic correctness.  And it nests 
> too (I believe).

This doesn't work too well, unfortunately. Firstly the argument(s) of
commentOut are still parsed, so if there is a syntax error (which creates
a problem during parsing), execution is halted. Furthermore, while
a series of statements (separated by newlines or semicolons) is not
acceptable as a function argument, so this approach is limited to
commenting out pieces that represent single expressions.

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


[Rd] Any plans for commenting out region via something like " /* */ "?
Jan T. Kim