Re: [Rd] Can a function know what other function called it?

2009-05-26 Thread Duncan Murdoch
On 5/24/2009 10:23 AM, Romain Francois wrote: Duncan Murdoch wrote: On 23/05/2009 4:55 PM, Robert Gentleman wrote: Kynn Jones wrote: [snip] and you have a breakpoint in bar, you could not (easily) distinguish which of the two calls to bar was active. There is no line counter or anything

Re: [Rd] Can a function know what other function called it?

2009-05-26 Thread Romain Francois
Duncan Murdoch wrote: On 5/24/2009 10:23 AM, Romain Francois wrote: Duncan Murdoch wrote: On 23/05/2009 4:55 PM, Robert Gentleman wrote: Kynn Jones wrote: [snip] and you have a breakpoint in bar, you could not (easily) distinguish which of the two calls to bar was active. There is no

Re: [Rd] Can a function know what other function called it?

2009-05-26 Thread Duncan Murdoch
On 5/26/2009 12:57 PM, Romain Francois wrote: Duncan Murdoch wrote: On 5/24/2009 10:23 AM, Romain Francois wrote: Duncan Murdoch wrote: On 23/05/2009 4:55 PM, Robert Gentleman wrote: Kynn Jones wrote: [snip] and you have a breakpoint in bar, you could not (easily) distinguish which of

Re: [Rd] Can a function know what other function called it?

2009-05-26 Thread Duncan Murdoch
On 5/26/2009 12:57 PM, Romain Francois wrote: Duncan Murdoch wrote: On 5/24/2009 10:23 AM, Romain Francois wrote: Duncan Murdoch wrote: On 23/05/2009 4:55 PM, Robert Gentleman wrote: Kynn Jones wrote: [snip] and you have a breakpoint in bar, you could not (easily) distinguish which of

Re: [Rd] Can a function know what other function called it?

2009-05-24 Thread Duncan Murdoch
On 23/05/2009 4:55 PM, Robert Gentleman wrote: Hi Kynn, Kynn Jones wrote: Suppose function foo calls function bar. Is there any way in which bar can find out the name of the function that called it, foo? essentially yes. You can find out about the call stack by using sys.calls and

Re: [Rd] Can a function know what other function called it?

2009-05-24 Thread Romain Francois
Duncan Murdoch wrote: On 23/05/2009 4:55 PM, Robert Gentleman wrote: Kynn Jones wrote: [snip] and you have a breakpoint in bar, you could not (easily) distinguish which of the two calls to bar was active. There is no line counter or anything of that sort available. The evaluator

[Rd] Can a function know what other function called it?

2009-05-23 Thread Kynn Jones
Suppose function foo calls function bar. Is there any way in which bar can find out the name of the function that called it, foo? There are two generalization to this question that interest me. First, can this query go farther up the call stack? I.e. if bar now calls baz, can baz find out the

Re: [Rd] Can a function know what other function called it?

2009-05-23 Thread Robert Gentleman
Hi Kynn, Kynn Jones wrote: Suppose function foo calls function bar. Is there any way in which bar can find out the name of the function that called it, foo? essentially yes. You can find out about the call stack by using sys.calls and sys.parents etc. The man page plus additional manuals

Re: [Rd] Can a function know what other function called it?

2009-05-23 Thread Kynn Jones
On Sat, May 23, 2009 at 4:55 PM, Robert Gentleman rgent...@fhcrc.org wrote: Hi Kynn, Kynn Jones wrote: Suppose function foo calls function bar.  Is there any way in which bar can find out the name of the function that called it, foo?  essentially yes. You can find out about the call stack