Skip to content
Prev 32762 / 63421 Next

Can a function know what other function called it?

On 5/24/2009 10:23 AM, Romain Francois wrote:
Here's a patch file that does this.  (Will it make it through to the 
mailing list?  We'll see.)  It's still in progress, so I'm not even 
ready to put it into R-devel, but you're welcome to try it out.

The basic idea is that it attaches srcref attributes to the values 
returned from sys.calls (which won't be displayed, but if you want to 
play with them you can) and to .Traceback (which traceback() will 
display).  debug() will also show them.

Not sure what bad side effects (e.g. on execution time) this has.

Duncan Murdoch
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: srcref.patch
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20090526/252500d2/attachment.pl>