Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2002-01-28 (03:30)
From: Mathieu Gagne <mathieug@e...>
Subject: [Caml-list] Location in source code

	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?


Mathieu Gagne.
Bug reports:  FAQ:
To unsubscribe, mail  Archives: