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: [EMAIL PROTECTED] | | *NEW* WWW: http://www.cmp.uea.ac.uk/people/jtk | *-----=< hierarchical systems are for files, not for humans >=-----* ______________________________________________ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel