On Fri, Aug 28, 2009 at 10:02 AM, Kevin Wright<kw.s...@gmail.com> wrote:
> On Fri, Aug 28, 2009 at 11:49 AM, Duncan Murdoch <murd...@stats.uwo.ca>wrote:
>
>> On 8/28/2009 12:33 PM, Kevin Wright wrote:

[...]

>> Now that doesn't sound like the browser.  Whatever debugger you are using
>> has a bug.
>>
>> Duncan Murdoch
>>
>>
> Ah, right you are.  Thanks for the clarification.  This is not a "browser"
> phenomenon, but due to using "ess-eval-line-and-step" (which is a kind of
> cut and paste, I guess) to go through the code in emacs.  (Maybe there's a
> better way?)
>
> In any case, using "} else" eliminates the problem.

It might, but I tend to write my code with all curly braces (both open
and close) on their own line, and will keep doing so because I get to
choose my own style.

The important question is what the parser thinks. Here's a simplified example:

> bar <- function(x) { if (x) { TRUE } else { FALSE } }
> print(bar, useSource=FALSE)
function (x)
{
    if (x) {
        TRUE
    }
    else {
        FALSE
    }
}

So, R itself thinks that it's OK to have the else starting on it's own
line. This means that if you tried to edit 'bar' in ESS (using C-c
C-d, for example), you would end up in the same situation (at least
for functions for which source is not retained, which include package
functions).

-Deepayan

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to