From: Dave Benjamin <dave@ramenlabs.com>
To: caml-list@yquem.inria.fr
Subject: Name of currently executing function
Date: Sun, 13 Jul 2008 22:27:02 -0700 [thread overview]
Message-ID: <487AE3A6.2080008@ramenlabs.com> (raw)
Hello,
Is there any way to find out the name of the currently executing
function from within an OCaml program? I guess, technically, I'm
interested in the grandparent. Something that would allow this:
let log msg =
Printf.eprintf "%s: %s\n%!"
(get_caller_function_name ())
msg
I'm guessing the above is not possible, but perhaps there's some way to
accomplish this using some combination of camlp4, back traces,
profiling, or debugging?
Thanks,
Dave
next reply other threads:[~2008-07-14 5:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-14 5:27 Dave Benjamin [this message]
2008-07-14 13:53 ` [Caml-list] " blue storm
2008-07-15 6:13 ` Dave Benjamin
2008-07-20 16:17 ` Dave Benjamin
2008-07-20 17:35 ` blue storm
2008-07-20 23:41 ` Dave Benjamin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=487AE3A6.2080008@ramenlabs.com \
--to=dave@ramenlabs.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).