caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <Jacques.Garrigue@inria.fr>
To: prevost@maya.com
Cc: caml-list@inria.fr
Subject: Re: What will the new syntax be like? (O'Caml + O'Labl)
Date: Mon, 06 Dec 1999 12:05:45 +0100	[thread overview]
Message-ID: <19991206120545J.garrigue@pauillac.inria.fr> (raw)
In-Reply-To: Your message of "05 Dec 1999 22:05:20 -0500" <87wvqskbv3.fsf@isil.maya.com>

From: John Prevost <prevost@maya.com>

> Can we get any hints on what the syntax of the O'Labl features in the
> new O'Caml will be like?  I do like the polymorphic variants and
> tagged/optional argument features of O'Labl, but I'm not too keen on
> their syntax:
> 
> let foo bar:a zub:b ?qux:c [< 10 >] ?woz:d =
>   match d with
>     | None -> a + b + c
>     | Some x -> a + b + c + d

Changes are rather small:

let foo bar:a zub:b ?qux:c{=10} ?woz:d () =
  match d with
  | None -> a + b + c
  | Some x -> a + b + c + d

Notice that you need a non-labeled argument after optional ones, due
to a change in semantics. Optional arguments are now only discarded if
the function is applied to a non-labeled argument appearing after them
the function type.
This change was necessary to resolve some ambiguities, and provide an
untyped semantics for the language.

> Things which freak me out:
> [...]

You may like or not the above notation for labels. We had discussions
here, and the conclusion was that putting spaces around type
annotations was a good thing anyway...

I will not answer in detail your other comments, but yes, the change
in notation for default arguments is to avoid the similarity with
stream parsers.

Variant types have also a cleaned-up syntax, where recursion works
like with objects.

> Anyway, what's in store for us in the next version of O'Caml?  I've
> thought Caml's syntax the cleanest of the ML family for some time, but
> warts like the above could make me change my mind.

It's hard to put that many new features in the language, keeping the
compatibility with all, and obtain a clean syntax. I must admit.
However I think that ocaml3 syntax is reasonable enough, at least
better than olabl's. A second attempt has its advantages.

By the way, the new version is not yet released, so if you have a
coherent syntax to propose for the new features, you can propose.

        Jacques
------------------------------------------------------
Jacques Garrigue, visiting INRIA from Kyoto University
		          Jacques.Garrigue at inria.fr




  reply	other threads:[~1999-12-07 12:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-06  3:05 John Prevost
1999-12-06 11:05 ` Jacques Garrigue [this message]
1999-12-07  7:35   ` John Prevost
1999-12-07 15:36 Don Syme
1999-12-07 18:21 ` Markus Mottl
1999-12-07 18:32 ` skaller

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=19991206120545J.garrigue@pauillac.inria.fr \
    --to=jacques.garrigue@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=prevost@maya.com \
    /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).