English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 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