caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Name of currently executing function
@ 2008-07-14  5:27 Dave Benjamin
  2008-07-14 13:53 ` [Caml-list] " blue storm
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Benjamin @ 2008-07-14  5:27 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-07-20 23:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-14  5:27 Name of currently executing function Dave Benjamin
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

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).