From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 8AB7F7EE7D for ; Mon, 1 Jun 2015 13:46:28 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of fabrissimo@gmail.com) identity=pra; client-ip=209.85.216.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="fabrissimo@gmail.com"; x-sender="fabrissimo@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of fabrissimo@gmail.com designates 209.85.216.180 as permitted sender) identity=mailfrom; client-ip=209.85.216.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="fabrissimo@gmail.com"; x-sender="fabrissimo@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qc0-f180.google.com) identity=helo; client-ip=209.85.216.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="fabrissimo@gmail.com"; x-sender="postmaster@mail-qc0-f180.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BQAQBhRWxVm7TYVdFcg2ReBoMYrFeQRoJ3hCcHPBABAQEBAQEBEQEBAQEBBgsLCSEuhCMBAQQSER0BLQsBAwwBBQULDQICCR0CAiISAQUBChIGExIQh3YDBgwNphU+MYs/hGSZIicDCQGEdiYBBQ6BE4oih3WBRQWFSgqGAYtqglKEC4FnlAESI4EVXINBPDGCRwEBAQ X-IPAS-Result: A0BQAQBhRWxVm7TYVdFcg2ReBoMYrFeQRoJ3hCcHPBABAQEBAQEBEQEBAQEBBgsLCSEuhCMBAQQSER0BLQsBAwwBBQULDQICCR0CAiISAQUBChIGExIQh3YDBgwNphU+MYs/hGSZIicDCQGEdiYBBQ6BE4oih3WBRQWFSgqGAYtqglKEC4FnlAESI4EVXINBPDGCRwEBAQ X-IronPort-AV: E=Sophos;i="5.13,532,1427752800"; d="scan'208";a="161224524" Received: from mail-qc0-f180.google.com ([209.85.216.180]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 Jun 2015 13:46:27 +0200 Received: by qcmi9 with SMTP id i9so46233971qcm.0 for ; Mon, 01 Jun 2015 04:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=S5jS+1UzmYa1pvFM1+WOzULM7w/tGpv6C+yZSp9LRqg=; b=bwG6RV/dK24cWFKbZPdnNBriUfR/6XUdIlpciAdu0retgJjKMrScdR31xPMTveV+ep 1dTjh0e+E0+AoZy4pQmzGwfL2tIQYYVnGA1AICV7qxtCOL0ci2v6qqDoWuvtlMysE18Y Yy12ys7r0XS1IBpU+wxUK/a18fQLpX64+MbhDhCzYIvJe3eL136grbjmkxGeG6PaUmpx ZniW6zkevkZig9u6TtRo9K8lsgelKj/ynCYBbKi8oTXss0vFh7FmVGsSu3FDGhMzXHGd tvbnAm2cBVs68vnHvrRgaCMvvOmrZzKpqtoW3ziilzPqeZ/go96mmbRglJLX6p8Pwoch mv5Q== X-Received: by 10.140.34.81 with SMTP id k75mr539794qgk.56.1433159186803; Mon, 01 Jun 2015 04:46:26 -0700 (PDT) MIME-Version: 1.0 Sender: fabrissimo@gmail.com Received: by 10.96.92.228 with HTTP; Mon, 1 Jun 2015 04:46:06 -0700 (PDT) In-Reply-To: <556C4512.2050002@free.fr> References: <556C4512.2050002@free.fr> From: Fabrice Le Fessant Date: Mon, 1 Jun 2015 13:46:06 +0200 X-Google-Sender-Auth: ZIqaDRUQKO-Cj5Rhuvq5cZJz9As Message-ID: To: Gustave Nimant Cc: Ocaml Mailing List Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] getting the name of a function from its body Recent versions of OCaml provide "__LOC__", "__FILE__", "__LINE__", "__MODULE__" and "__POS__" primitives that can be used to display precise error messages. --Fabrice On Mon, Jun 1, 2015 at 1:42 PM, Gustave Nimant wrote: > Hello, > > is there any way in OCaml to get the name of a function from its body, in > order to write precise error messages for instance ? > > Regards > Gustave > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs -- Fabrice LE FESSANT Chercheur en Informatique INRIA Paris Rocquencourt -- OCamlPro Programming Languages and Distributed Systems