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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 18B867EE7D for ; Mon, 1 Jun 2015 20:07:56 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of yotambarnoy@gmail.com) identity=pra; client-ip=209.85.213.52; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of yotambarnoy@gmail.com designates 209.85.213.52 as permitted sender) identity=mailfrom; client-ip=209.85.213.52; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-yh0-f52.google.com) identity=helo; client-ip=209.85.213.52; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="postmaster@mail-yh0-f52.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A5AwBunmxVlDTVVdFcg2ReBoMYrF6ONoINgneDAAKBLgc8EAEBAQEBAQERAQEBAQcLCwkfMIQiAQEBAwESER0BGxILAQMBCwYFBAcNDR0CAiIBEQEFAQoSBhMSEId1AQMGBAgNqCU+MYs/gWuCeZknChknAwkBV4Q8AQEBAQEBBAEBAQEBARYBBQ6LNYUCBAeCaIFFBYVKCoYDhHuGdIZggWmUBRIjgQwJhDciMQGCRgEBAQ X-IPAS-Result: A0A5AwBunmxVlDTVVdFcg2ReBoMYrF6ONoINgneDAAKBLgc8EAEBAQEBAQERAQEBAQcLCwkfMIQiAQEBAwESER0BGxILAQMBCwYFBAcNDR0CAiIBEQEFAQoSBhMSEId1AQMGBAgNqCU+MYs/gWuCeZknChknAwkBV4Q8AQEBAQEBBAEBAQEBARYBBQ6LNYUCBAeCaIFFBYVKCoYDhHuGdIZggWmUBRIjgQwJhDciMQGCRgEBAQ X-IronPort-AV: E=Sophos;i="5.13,534,1427752800"; d="scan'208";a="132921374" Received: from mail-yh0-f52.google.com ([209.85.213.52]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 Jun 2015 20:07:55 +0200 Received: by yhom41 with SMTP id m41so35473904yho.1 for ; Mon, 01 Jun 2015 11:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=QchqcNjHeq4julnfhckX6rin5yf8YdcCpsVCr1yP6f8=; b=t807OCCwe2ObU9TDkO9hr2kLFG+DskUzasDUR66VU5mm8usGvLbWSwKKEuV8iLAFhE RguinB01nIWBC/yf6CcP8XdH0IzByrfuCTmh054mnEfxMNav35PxlsQJFMN3+ZP96vGw 7CVCrANM8RZujomQz0SueN4xScUB8KDVTz5aN1+RSpkqk90Jq3dfLbFAP/xmFjtGpjHV i95dWH7B/WZtX0EymD1eastaqi4BNtagzuyVCPUuys46ddGn6h8NO6i/unU6B1BEHnUi xi5Y425ftZQljLQxyc5oXpi0oBVNoBS4zCJCK/Vvg9QMAquNEkhbwCF9hFeEq150THwi 5p9w== X-Received: by 10.170.186.7 with SMTP id c7mr27605084yke.54.1433182073719; Mon, 01 Jun 2015 11:07:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.43.132 with HTTP; Mon, 1 Jun 2015 11:07:33 -0700 (PDT) In-Reply-To: <556C9887.70502@free.fr> References: <556C4512.2050002@free.fr> <556C89F3.3000206@free.fr> <556C8C74.5030809@inria.fr> <556C9887.70502@free.fr> From: Yotam Barnoy Date: Mon, 1 Jun 2015 14:07:33 -0400 Message-ID: To: Gustave Nimant Cc: "caml-list@inria.fr" Content-Type: multipart/alternative; boundary=001a1139fec06711f0051778b4de Subject: Re: [Caml-list] getting the name of a function from its body --001a1139fec06711f0051778b4de Content-Type: text/plain; charset=UTF-8 The argument makes no sense since inlining would also affect MODULE, FILE, etc. It seems more like an omission. -Yotam On Mon, Jun 1, 2015 at 1:38 PM, Gustave Nimant wrote: > On 01/06/2015 18:46, Francois Berenger wrote: > >> >>> It seems that the functions described in >>> http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html >>> do not answer my question : >>> "how to get the name of the current function ?" >>> >> >> It is currently not possible. >> >> There is no __FUNCTION__ like you have in C. >> I was also quite interested by this feature a long time ago. >> For loggers it is quite useful. >> >> I cannot find the thread back, I don't know where to search the archives >> of caml-list. >> Gabriel Scherer mentioned there is not always a function name since >> they can be inlined by the compiler, if I remember correctly. >> > I hope the argument of the inlining case is not serious, is it ? > > Best, > 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 > --001a1139fec06711f0051778b4de Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The argument makes no sense since inlining would also affe= ct MODULE, FILE, etc. It seems more like an omission.

-Y= otam

O= n Mon, Jun 1, 2015 at 1:38 PM, Gustave Nimant <gustave.nimant@free.fr= > wrote:
O= n 01/06/2015 18:46, Francois Berenger wrote:

It seems that the functions described in
http://caml.inria.fr/pub/docs/manual-ocaml/libref/Perv= asives.html
do not answer my question :
"how to get the name of the current function ?"

It is currently not possible.

There is no __FUNCTION__ like you have in C.
I was also quite interested by this feature a long time ago.
For loggers it is quite useful.

I cannot find the thread back, I don't know where to search the archive= s
of caml-list.
Gabriel Scherer mentioned there is not always a function name since
they can be inlined by the compiler, if I remember correctly.
I hope the argument of the inlining case is not serious, is it ?

Best,
Gustave



--
Caml-list mailing list.=C2=A0 Subscription management and archives:
ht= tps://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

--001a1139fec06711f0051778b4de--