[ESS] ESS 13.05 produces wrong behavior in browser() debugging for loops

Vitalie Spinu spinuvit at gmail.com
Wed Jun 19 23:30:44 CEST 2013


 >> Levi Waldron <lwaldron.research at gmail.com>
 >> on Wed, 19 Jun 2013 16:29:21 -0400 wrote:

 > On Tue, Jun 18, 2013 at 7:10 PM, Vitalie Spinu <spinuvit at gmail.com> wrote:
 >> > to, and often expand
 >> 
 >> What is expanding a function? Do you mean evaluate?
 >> 

 > Thank you again, Vitalie.

 > By expand, I meant adding new code to a function while in debug mode within
 > that function.  For example, starting a function by writing this:

 > Fun <- function(x){
 >     browser()
 > }

 > then calling Fun(3) and writing the function with the Browse[1]>  prompt in
 > the inferior R process.  Then without stepwise mode, I can add a loop or
 > conditional and have it run through and return to the same browser level,
 > or stop within it by adding another browser() statement then return to the
 > first browser level with "c".  The above example is silly, but I do often
 > find this approach convenient when writing functions of many input
 > variables.

Interesting work flow. It is the same type of problem I have reported on
R-devel. Debugger should not step through user-entered blocks. Be it
"for" loops or simply {1+2}. It would be nice if you could report this
as an R bug. More people complain, faster it will be solved.

In the R documentation empty line and "n" are equivalent. In reality
they behave differently.

 > Is there a straightforward way to change my ESS default to not enter
 > stepwise mode, since it appears from ?browser that 'n' is
 > irreversible?

On ESS side there is an in-built workaround
ess-debug-skip-first-call. Set it to nil and you won't be immediately
dropped into step mode (but also not into visual debugger). Beware that
if you start using step shortcut (M-N) ESS will start sending "n" again.

I will try changing ESS debugger to send empty lines instead of "n". I
think I have tried this before and it didn't work well. So may be a
custom variable for what letter to send is justified here.

    Vitalie



More information about the ESS-help mailing list