caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <Jacques.Garrigue@inria.fr>
To: bpr@best.com
Cc: caml-list@inria.fr
Subject: Re: How do I ..
Date: Mon, 20 Dec 1999 12:06:36 +0100	[thread overview]
Message-ID: <19991220120636F.garrigue@pauillac.inria.fr> (raw)
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>

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




  reply	other threads:[~1999-12-20 16:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-18  7:02 skaller
1999-12-18 17:59 ` Brian Rogoff
1999-12-20 11:06   ` Jacques Garrigue [this message]
1999-12-20 20:16     ` Brian Rogoff
1999-12-21 17:39       ` Jacques Garrigue
1999-12-18 18:09 ` David Brown
1999-12-18 17:41 Juergen Pfitzenmaier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19991220120636F.garrigue@pauillac.inria.fr \
    --to=jacques.garrigue@inria.fr \
    --cc=bpr@best.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).