From lwaldron.research at gmail.com  Wed Dec 31 22:06:09 2014
From: lwaldron.research at gmail.com (Levi Waldron)
Date: Wed, 31 Dec 2014 16:06:09 -0500
Subject: [Rd] Unexpected behavior of debug() in step-wise mode
Message-ID: <CAOUXvx7Rt45uKGUXvr6xgF3xkfSwLRqecKEmjR6Qcj0Fvvnfxg@mail.gmail.com>

Why does debug() enter Browse[3] here at all, and why does it happen the
first time and not the second? This seems unexpected to me, and has
undesirable effects for ESS users (that I reported here -
https://stat.ethz.ch/pipermail/ess-help/2013-June/009154.html - but just
realized my post to r-devel didn't make it through when I tried to report
it back then).

> Fun <- function(n) print(n)
> debug(Fun)
> Fun(2)
debugging in: Fun(2)
debug: print(n)
Browse[2]> {n+2}
debug at #1: n + 2
Browse[3]> c
[1] 4
Browse[2]> {n+2}
[1] 4
Browse[2]> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

	[[alternative HTML version deleted]]



[Rd] Unexpected behavior of debug() in step-wise mode
Levi Waldron