[Rd] RE: [R] debugging non-visible functions

Duncan Murdoch murdoch at stats.uwo.ca
Wed Oct 13 16:09:14 CEST 2004


On Wed, 13 Oct 2004 11:38:00 +0100 (BST), Prof Brian Ripley
<ripley at stats.ox.ac.uk> wrote :

>> > From: Prof Brian Ripley
>> [snip]
>> > Luke Tierney recommends removing the NAMESPACE file during 
>> > development of 
>> > a package if you need frequent access to debug/change its functions.
>> 
>> But isn't that a bit troublesome if there is a shared object to be loaded in
>> the NAMESPACE file?  If I rename the NAMESPACE file to something else, I
>> would need to put back library.dynam() in .First.lib(), right?  I thought it
>> might work to write some code in .First.lib that checks for existence of
>> NAMESPACE, and call libaray.dynam() conditionally.  Does this sound about
>> right?

For 2.1.0, would it be reasonable to extend debug() the way ? was
extended?  E.g. allow

debug(plot(x))

and have the debugging flag be set on the appropriate function,
whatever and wherever it happens to be?  There's some ambiguity with
S3 methods (did you want to debug the generic or the method?), but I
think defaulting to debugging of the method would be reasonable.  (And
I think ? needs to be extended to handle S3 methods too, but that's a
different question.)

Duncan Murdoch



More information about the R-devel mailing list