Re: How do I ..

From: Jacques Garrigue (
Date: Mon Dec 20 1999 - 12:06:36 MET

Subject: Re: How do I ..
In-Reply-To: Your message of "Sat, 18 Dec 1999 09:59:00 -0800 (PST)"
Message-Id: <>
Date: Mon, 20 Dec 1999 12:06:36 +0100
From: Jacques Garrigue <>

From: Brian Rogoff <>

> > I'm confused:
> >
> > Objective Caml version 2.99 (99/12/08)
> >
> > # let f (lx:x : int) = x + 1;;
> > Syntax error
> Try "#modern true;;" at the top level, or compile with the -modern switch.
> I hope this modern/classic mode distinction is just a temporary thing.

For this specific point of syntax, prohibiting it in classic mode is
just temporary. This is intended to avoid bad behaviour on legacy
programs, like "let f (x:int) = x + 1;;", where x: would interpreted
as a label. Better to have a syntax error at once, rather than a
"unbound value int" later on. Note that we cannot avoid all such
cases, but this does not seem a good idea to have lots of them.

As to the existence of two modes, I expect it to stay around for a bit

Clearly, there are supporters for both styles. Those who may like to
put some labels in their interfaces, but do not want to have to put
labels in every line of code, and those who value the extra expressive
power of doing so.

One solution would have been no classic mode, but two standard
libaries, with or without labels. This might have worked ok, but this
meant that the programming style was choosen by the author of the
library, rather than by its user.

With two modes, libraries can be written in any style, and
they can be used (more or less) comfortably in both styles.

Jacques Garrigue, visiting INRIA from Kyoto University
                          Jacques.Garrigue at

This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:29 MET