Jan T. Kim <jtk <at> cmp.uea.ac.uk> writes:
: Out of personal interest: Does anyone here know why the R parser was
: designed this way? Personally, I have been coding in R for years in the
: belief that newline is whitespace, and never even noticed any problems
: because all my ifs with elses were within functions and thus enclosed
: in curly braces.
:
If it did not work that way it would require console lookahead. That is
it would not know that the if statement was finished and would have
to wait for the following statement to be completely typed in before
it could process the if. The way it works now the if statement can
be processed immediately.