From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA09669 for caml-redistribution@pauillac.inria.fr; Fri, 17 Mar 2000 16:25:35 +0100 (MET) Resent-Message-Id: <200003171525.QAA09669@pauillac.inria.fr> Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA31770 for ; Fri, 17 Mar 2000 11:09:58 +0100 (MET) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id LAA05701 for ; Fri, 17 Mar 2000 11:09:56 +0100 (MET) Received: from localhost (sansho.kurims.kyoto-u.ac.jp [130.54.16.90]) by kurims.kurims.kyoto-u.ac.jp (8.9.3/3.7W) with ESMTP id TAA27698; Fri, 17 Mar 2000 19:09:41 +0900 (JST) To: prevost@maya.com Cc: caml-list@inria.fr Subject: Re: Syntax for label, NEW PROPOSAL In-Reply-To: Your message of "15 Mar 2000 12:04:45 -0500" <87k8j4p3ki.fsf@isil.localdomain> References: <87k8j4p3ki.fsf@isil.localdomain> X-Mailer: Mew version 1.93 on Emacs 20.5 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20000317191134Y.garrigue@kurims.kyoto-u.ac.jp> Date: Fri, 17 Mar 2000 19:11:34 +0900 From: Jacques Garrigue X-Dispatcher: imput version 980905(IM100) Resent-From: weis@pauillac.inria.fr Resent-Date: Fri, 17 Mar 2000 16:25:35 +0100 Resent-To: caml-redistribution@pauillac.inria.fr Hi John, > I think this could be made sane by a reform of how the optional > arguments work. There are a couple of interesting possibilities: > > # let f ?style:x _ = x;; > - val f : ?style:('a option) -> 'b -> 'a option > > # let f (style:x : 'a option) _ = x > - val f : style:('a option) -> 'b -> 'a option Bingo, you've just found how it's implemented! Omitting the option constructor for optional arguments is just a small comfort. This can be pretty important when you have 10 or 20 optional arguments in the same function. By the way, having a default case for a non-optional argument was legal in O'Labl. I just didn't include it in O'Caml because I thought I would be more confusing than useful. > The first is dirty because there are two kinds of special arguments > (optional and non-optional). The second because it gets into the type > system. I think the second must lose, since "knowing" that something > is an option type is complex. In fact the distinction between optional and non-optional arguments is useful, because it allows a nice interaction between classic and modern mode. Optional ones behave the same in both modes, only non-optional ones behave differently. [..] > Of course, this is all radically different from O'Labl, so it will > never happen. I do not intend to be so exclusive... In fact there are even a number of differences between ocaml 2.99 and olabl, and some from you. The only point is that O'Labl has been around for a while, and we have had the time to test in practice that this model works, and is not difficult to grasp. Another model would take lots of time testing again. Best regards, Jacques