To: bpr@best.com
Subject: Re: How do I ..
In-Reply-To: Your message of "Sat, 18 Dec 1999 09:59:00 -0800 (PST)"
<Pine.BSF.4.21.9912180941460.29900-100000@shell5.ba.best.com>
Message-Id: <19991220120636F.garrigue@pauillac.inria.fr>
Date: Mon, 20 Dec 1999 12:06:36 +0100
From: Jacques Garrigue <Jacques.Garrigue@inria.fr>
From: Brian Rogoff <bpr@best.com>
> > 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
longer.
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
------------------------------------------------------
Jacques Garrigue, visiting INRIA from Kyoto University
Jacques.Garrigue at inria.fr
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:29 MET