From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p72LGaaZ026714 for ; Tue, 2 Aug 2011 23:16:36 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao0DAIZoOE5CbwQakWdsb2JhbABCmFaPEhQBAQEBCQsLBxQEIYFAAQEFQDgCDwsYCRYPCQMCAQIBRRMIAQGHbL89BYZCh16QKIt9 X-IronPort-AV: E=Sophos;i="4.67,307,1309730400"; d="scan'208";a="104545684" Received: from out2.smtp.messagingengine.com ([66.111.4.26]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 02 Aug 2011 23:16:31 +0200 Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.messagingengine.com (Postfix) with ESMTP id 070D820535 for ; Tue, 2 Aug 2011 17:16:30 -0400 (EDT) Received: from frontend2.messagingengine.com ([10.202.2.161]) by compute3.internal (MEProxy); Tue, 02 Aug 2011 17:16:30 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=ILcLSZQ/hI18+gJnWNDjOZ nosH0=; b=VE8GvJx9+AEViiz08vrlzJBHszltPMrhYTM8MkN4GwmXS45PPx07p5 cZYHbTZwqDRY8OIrv4RFGk9nWpMM41tviRLz7DDKN3mL00uBdGDUpZhwVOo9cKnA qhQLiIkr0iNiDAxDp6oe/mXwKvV2CIu/N+XzutUUxER2Tim/2OVTk= X-Sasl-enc: nvV/d2U7T+/nUNSLMCncW4zwIlYioP0aOTfSg3+9bs99 1312319789 Received: from [192.168.1.206] (64-71-1-165.static.wiline.com [64.71.1.165]) by mail.messagingengine.com (Postfix) with ESMTPSA id 9CDA0457A99 for ; Tue, 2 Aug 2011 17:16:29 -0400 (EDT) Message-ID: <4E386A65.8080000@ens-lyon.org> Date: Tue, 02 Aug 2011 14:21:41 -0700 From: Martin Jambon User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20101023 Lightning/1.0b3pre Thunderbird/3.1.3 MIME-Version: 1.0 To: caml-list@inria.fr References: <4E37EBA3.6040800@fugmann.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] filename and line number. On 08/02/11 05:45, Gabriel Scherer wrote: > Finally, Martin Jambon also has its own "cppo" tools mimicking cpp, > which I suppose doesn't rely on camlp4, and has __FILE__ and __LINE__ > macros which may be in a more directly exploitable format. I have > never tried it though. See: > http://martin.jambon.free.fr/cppo.html That's correct. Thanks for the plug. Here is an example: $ cat loc.ml #define loc (Printf.sprintf "File %S, line %i" __FILE__ __LINE__) print_endline loc;; print_endline loc;; $ ocamlopt -o loc -pp cppo loc.ml; ./loc File "loc.ml", line 3 File "loc.ml", line 4 Martin