Documentation tweak for ?traceback

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Documentation tweak for ?traceback

R devel mailing list
The addition of `.traceback` in r70207 adds one more function to the call stack when invoking `traceback()`.  This changes the output of one of the examples to include the error handler call:


> options(error = function() traceback(2))
> foo(2)
[1] 1
Error in bar(2) : object 'a.variable.which.does.not.exist' not found
3: (function ()
   traceback(2))() at #1
2: bar(2) at #1
1: foo(2)

The attached trivial patch cleans up the example so that the above looks like it would have under r<70207.
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

traceback-docs-1.txt (604 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Documentation tweak for ?traceback

Martin Maechler
>>>>> brodie gaslam via R-devel
>>>>>     on Thu, 11 Jul 2019 03:14:53 +0200 writes:

>    The addition of `.traceback` in r70207 adds one more function to the
   > call stack when invoking `traceback()`.  This changes the output of one
   > of the examples to include the error handler call:
   > > options(error = function() traceback(2))
   > > foo(2)
   > [1] 1
   > Error in bar(2) : object 'a.variable.which.does.not.exist' not found
   > 3: (function ()
   >    traceback(2))() at #1
   > 2: bar(2) at #1
   > 1: foo(2)
   > The attached trivial patch cleans up the example so that the above
   > looks like it would have under r<70207.

Indeed, thanks a lot, Brodie!
There was a bit more to change -- the options() setting
is also mentioned in the main text.

Committed to R-devel and R-patched now.

Martin Maechler
ETH Zurich and  R Core Team

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel