You can also put several functions on the same line... The argument does not make much sense. It is eventually up to the developer of a module to ensure that error messages are unique (enough). I guess it is simply an implementation issue. The name of the current function is not at hand where this kind of macros is expanded. Gerd Am Montag, den 01.06.2015, 23:57 +0200 schrieb Fabrice Le Fessant: > The main reason for the absence of __FUNCTION__ is probably that it > does not really make sense : you might have several functions with the > same name within the same module : > > let f x = x+1 > let f list = List.map f list > > It makes sense in C, because you can only define a symbol once in a > file, so the pair (__FILE__, __FUNCTION__) is uniq (and if the > function is not static, it is probably even uniq within the > executable). > > In OCaml, it is probably better to use the pair (__FILE__, __LINE__) > to tell the dev where to search for the problem. > > --Fabrice > > > > > > On Mon, Jun 1, 2015 at 6:36 PM, Gustave Nimant wrote: > > On 01/06/2015 13:46, Fabrice Le Fessant wrote: > >> > >> Recent versions of OCaml provide "__LOC__", "__FILE__", "__LINE__", > >> "__MODULE__" and "__POS__" primitives that can be used to display > >> precise error messages. > >> > >> --Fabrice > > > > Thank you for this information I was not aware of. > > 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 ?" > > > > Do I miss something ? > > > > > > 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 > -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------