Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Location in source code
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mathieu Gagne <mathieug@e...>
Subject: [Caml-list] Location in source code
Hello,

	I would like to be able to define in OCaml analogues of the cpp macros 
__FILE__ and __LINE__, for debugging purposes.  For instance, I would like to 
be able to write

Printf.printf "I had an error in module %s at line %d" __MODULE__ __LINE__

or something similar.  __MODULE__ would expand to the fully qualified module 
name.  I expect something like this might be possible using camlp4, but I 
can't figure out how.  Does anyone have any idea how to achieve this?

Best,

Mathieu Gagne.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr