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
Question about O'Caml 3
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-04-28 (10:06)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: Question about O'Caml 3
From: Thorsten Ohl <>

> Contrary to the documentation, O'Caml 3.00 accepts, lowercase
> identifiers for polymorphic variants.
> ohl@heplix4:~Mail$ ocaml
>         Objective Caml version 3.00
> # `foo;;
> - : [> `foo] = `foo
> Who's right: the compiler or the manual?

Well, we were so busy discussing label syntax that this point was not
debated before 3.00.
The current answer is: both are correct.

If you want to be on the safe side, better not to use lowercase
variants, since they could be removed in the future.
Also they are probably not so nice if you are really intending to use
them as sum types, which are usually identified by their uppecase
first letter.
On the other hand, I have a personal liking for lowercase variants, at
least when they have only an abstract meaning (not really used as
values, but rather as types, and types are lowercase).

Some libraries, namely lablGL and lablGTK (only internally for
lalblGTK), actually use lowercase labels, so I prefered to keep them
for now in the compiler, as they are not harmful, rather than having
to correct everything before a real decision is taken.

Jacques Garrigue      Kyoto University     garrigue at
		<A HREF=>JG</A>