From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA17936 for caml-redistribution; Tue, 7 Dec 1999 13:23:02 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA31633 for ; Mon, 6 Dec 1999 12:05:54 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id MAA20161; Mon, 6 Dec 1999 12:05:46 +0100 (MET) Received: from localhost (riesling.inria.fr [128.93.8.51]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA10959; Mon, 6 Dec 1999 12:05:45 +0100 (MET) To: prevost@maya.com Cc: caml-list@inria.fr Subject: Re: What will the new syntax be like? (O'Caml + O'Labl) Reply-To: Jacques.Garrigue@inria.fr In-Reply-To: Your message of "05 Dec 1999 22:05:20 -0500" <87wvqskbv3.fsf@isil.maya.com> References: <87wvqskbv3.fsf@isil.maya.com> X-Mailer: Mew version 1.93 on Emacs 20.4 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <19991206120545J.garrigue@pauillac.inria.fr> Date: Mon, 06 Dec 1999 12:05:45 +0100 From: Jacques Garrigue X-Dispatcher: imput version 980905(IM100) Sender: weis From: John Prevost > 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