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 UAA12030; Wed, 8 Oct 2003 20:04:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA25822 for ; Wed, 8 Oct 2003 20:04:35 +0200 (MET DST) Received: from mail.eecs.harvard.edu (bowser.eecs.harvard.edu [140.247.60.24]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h98I4Y109417 for ; Wed, 8 Oct 2003 20:04:34 +0200 (MET DST) Received: by mail.eecs.harvard.edu (Postfix, from userid 32018) id 9AFE554C47D; Wed, 8 Oct 2003 14:04:33 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.eecs.harvard.edu (Postfix) with ESMTP id 9887D54C468 for ; Wed, 8 Oct 2003 14:04:33 -0400 (EDT) Date: Wed, 8 Oct 2003 14:04:33 -0400 (EDT) From: Lex Stein To: caml-list@inria.fr Subject: [Caml-list] line numbers in exceptions Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: caml-list@inria.fr X-Spam: no; 0.00; stein:01 stein:01 ocamlc:01 ocamlopt:01 pump:99 ocaml:01 -custom:01 int:01 dump:01 exception:02 exception:02 stack:02 macros:03 eecs:03 eecs:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, Is there a general strategy for getting the line number information into exceptions. An exception call stack dump doesn't always work (for example, with ocamlc -custom or ocamlopt). To figure out where my exception is being raised, I'd like to paramaterize the exception by the int line number. I don't want to enter this by hand because the exception will change lines as I edit the code. Is there something like cpp's __LINE__ and __FILE__ macros in OCaml? Or is the best way to just pump the code through cpp before compilation? Thanks, Lex -- Lex Stein http://www.eecs.harvard.edu/~stein/ stein@eecs.harvard.edu cell: 617-233-0246 ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners