From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 0E36ABC6B for ; Thu, 26 Jul 2007 15:51:11 +0200 (CEST) Received: from peray.inria.fr (ausone.inria.fr [128.93.8.95]) by discorde.inria.fr (8.13.6/8.13.6) with SMTP id l6QDp7oj014864; Thu, 26 Jul 2007 15:51:07 +0200 Received: by peray.inria.fr (sSMTP sendmail emulation); Thu, _d Jul 2007 15:50:43 +0200 From: "Nicolas Pouillard" Cc: caml-list Subject: Re: [Caml-list] Question on camlp4 3.10 To: Benedikt Grundmann References: <9b415f950707260646v2dd6be3ds71a6d6ff3cd12fd8@mail.gmail.com> In-Reply-To: <9b415f950707260646v2dd6be3ds71a6d6ff3cd12fd8@mail.gmail.com> Date: Thu, 26 Jul 2007 15:50:43 +0200 Message-Id: <1185457805-sup-9231@ausone.inria.fr> User-Agent: Sup/0.1 Content-Disposition: inline Content-Type: text/plain; charset=utf-8 X-j-chkmail-Score: MSGID : 46A8A6CB.001 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46A8A6CB.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 camlp:01 syntax:01 endline:01 struct:01 endline:01 cheers:01 caml-list:01 module:03 module:03 macro:03 let:03 let:03 benedikt:03 shell:04 Look at the Camlp4MacroParser extension, there is __FILE__. Excerpts from Benedikt Grundmann's message of Thu Jul 26 15:46:26 +0200 2007: > How can I get the name of the module where my syntax extension is > applied? For simplicity assume that I would like to write a MODULE > macro similar to __FILE__ in c. > > shell> cat > test.ml > let _ = print_endline MODULE > > shell> ./test > Test > shell> cat > test2.ml > module M = > struct > let _ = print_endline MODULE > end > > shell> ./test2 > Test.M > > > Cheers, > > Bene > -- Nicolas Pouillard aka Ertai