From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id EAA16342; Mon, 28 Jan 2002 04:30:05 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA15229 for ; Mon, 28 Jan 2002 04:30:04 +0100 (MET) Received: from harrier.prod.itd.earthlink.net (harrier.mail.pas.earthlink.net [207.217.120.12]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g0S3U2v14749 for ; Mon, 28 Jan 2002 04:30:02 +0100 (MET) Received: from bstnma1-ar1-4-3-188-166.elnk.dsl.gtei.net ([4.3.188.166] helo=there) by harrier.prod.itd.earthlink.net with smtp (Exim 3.33 #1) id 16V2UX-0004qO-00 for caml-list@inria.fr; Sun, 27 Jan 2002 19:29:57 -0800 Content-Type: text/plain; charset="iso-8859-15" From: Mathieu Gagne Reply-To: mathieug@earthlink.net To: caml-list@inria.fr Subject: [Caml-list] Location in source code Date: Sun, 27 Jan 2002 22:35:12 -0500 X-Mailer: KMail [version 1.3.1] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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