Re: [Rd] Am I missing something about debugging?

From: Duncan Murdoch <>
Date: Tue 02 Jan 2007 - 23:44:22 GMT

On 1/2/2007 5:46 PM, Ross Boylan wrote:
> On Tue, 2007-01-02 at 17:24 -0500, Duncan Murdoch wrote:

>> I don't think you're missing anything with the debug() function. It 
>> needs updating.

> Bummer!
>> I don't think there's any structural reason why you shouldn't be able to 
>> do the things you're talking about in R, but they haven't been 
>> implemented.

> That's good to know. I was wondering if the lexical scoping was
> complicating things. At least the way I think of it, every call has two
> sets of (potentially) nested environments: the lexical scopes of the
> function definition and the dynamic scopes of the call. But since the
> dynamic scopes are available, using them seems possible.

I wouldn't call the dynamic scopes "nested", more like "chained". If a search fails in one of them, it never looks in the next one: only the lexical scope nesting does that.

>> Mark Bravington put together a package (called debug) that does more 
>> than debug() does, but I haven't used it much, and I don't know if it 
>> does what you want.

> It looked to me as if it was some help, but no advance on the
> investigating dynamic frames front.
>> I recently added things to the R parser to keep track of connections 
>> between R code and source files; that was partly meant as a first step 
>> towards improving the debugging facilities.  I'd be happy to help anyone 
>> who wants to do the hard work, but I don't think I'll be able to work on 
>> it before next summer.  (If you do decide to work on it, please let me 
>> know, just in case I do get a chance:  no point duplicating effort.)

> I didn't even realize such a facility was needed, which shows how much I
> know! Working on the debugger is probably not in my job description,
> unless I get really annoyed.
> The smalltalk debugger is the standard by which I judge all others; it's
> just amazing. You can go up and down the stack, graphically examine
> variables (and follow links), and change code in the middle of debugging
> and then continue.

Everything except the "change code" part is pretty standard in a modern debugger; I'd hope an R debugger could do them. An interpreter like R could allow changes, but I'm not sure what the user interface would look like...

Duncan Murdoch mailing list Received on Wed Jan 03 10:51:16 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 03 Jan 2007 - 01:31:07 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.