From kynnjo at gmail.com  Sat May 23 22:37:14 2009
From: kynnjo at gmail.com (Kynn Jones)
Date: Sat, 23 May 2009 16:37:14 -0400
Subject: [Rd] Can a function know what other function called it?
Message-ID: <c2350ba40905231337u5ead6f97o95ee24f2faea081e@mail.gmail.com>

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 name of the function that called the
function that called it, i.e. "foo"?  Second, what other information,
beside its name, can bar find about the environment where it was
called?  E.g. can it find out the file name and line number of the
function call?

Thanks!



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