Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Ocaml and Samba function name collisions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-25 (07:52)
From: Nicolas Cannasse <warplayer@f...>
Subject: Re: [Caml-list] Ocaml and Samba function name collisions
> > The synopsis of this message is to ask that the Ocaml source
> > code prepend a Ocaml specific string, "ml_", "caml_" or "ocaml_"
> > to all function names in Ocaml's source code to avoid name
> > collisions with other packages.  My case is made below :)
> I will definitely sign this petition. I had a similar problem while
> trying to write an ocaml binding to the graphviz library. Both the
> libraries defined, IIRC, a color struct used in graphviz for node colors
> and in ocaml by the GC :-(

This is not a primitive name problem, but a data structure one (when
including file).
It can be easily resolved by using a #define color caml_color (or the
working equivalent) before including the caml headers.
Other solution is to put the caml headers into a C++ namespace.
BTW I'm not signing this petition : having everything prefixed with caml_ is
way to heavy. But for theses string_get string_set primitives that's true
the naming is too much generic and proper to name collision. Only theses
kinds should be renamed.

Nicolas Cannasse

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: