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 QAA24005 for caml-redistribution@pauillac.inria.fr; Fri, 24 Mar 2000 16:48:32 +0100 (MET) Resent-Message-Id: <200003241548.QAA24005@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 DAA25961 for ; Fri, 24 Mar 2000 03:42:27 +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 DAA24396 for ; Fri, 24 Mar 2000 03:42:25 +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 LAA02547; Fri, 24 Mar 2000 11:41:03 +0900 (JST) To: maxs@in.ot.com.au Cc: mottl@miss.wu-wien.ac.at, bpr@best.com, caml-list@inria.fr Subject: Re: to have labels or not In-Reply-To: Your message of "Thu, 23 Mar 2000 11:57:47 +1100" <38D96C0B.64621301@in.ot.com.au> References: <38D96C0B.64621301@in.ot.com.au> 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: <20000324114102E.garrigue@kurims.kyoto-u.ac.jp> Date: Fri, 24 Mar 2000 11:41:02 +0900 From: Jacques Garrigue X-Dispatcher: imput version 980905(IM100) Resent-From: weis@pauillac.inria.fr Resent-Date: Fri, 24 Mar 2000 16:48:32 +0100 Resent-To: caml-redistribution@pauillac.inria.fr From: Max Skaller > The arguments about the standard library seem to me to be this: some of > the > ocaml (classic) users like myself would prefer to move to the > modern/strict/label > mode and get rid of the classic mode. But we're not willing to do so if > it > clutters our use of the standard library. This is a reasonable argument. However, by discussing with olabl users (many of them being originally ocaml users) I really got the feeling that the fact to have to write labels for standard library functions didn't bother them. I wouldn't be honest if I don't admit that there are some exceptions, but then everybody cannot agree on everything. And olabl didn't provide anything similar to classic mode, just a raw compatibility mode in which you couldn't use optionals at all. So before deciding whether you want to stay classic or go to commuting label mode, you might just give it an (extensive enough) try. By the way, it seems that there will be less labels in the standard library in 3.00. > I do not feel I gain the real advantage of labels with GUI/PCRE > type libraries _unless_ the labelled optional argument things > commute. I also don't want to clutter use of simple > standard library functions with labels. Here is probably the biggest misunderstanding. In classic mode, optional arguments _do commute_. Only non-optional and unlabelled ones do not. And I would say that for most people (at least those with a pure ocaml background), the only commutations that matter are those between optional arguments. Remark for instance that Markus Mottl himself explained that he was using only classic mode. > So here's a suggestion. Get rid of classic mode. > But have TWO complete standard libraries: > > module Classic = .. put classic modules here .. > module Olabl = put labelled versions here We thought about that. And even tried it before releasing 2.99. I am the one who pushed against this solution, because I felt this would really cause a community split. The problem is not just the standard library. If you do not have classic mode, then it means that everybody will have to write all labels. If you have a look at LablGL, you will see that I use there plenty of non-optional labels, and very few optional ones. I'm pretty sure people would start asking me to remove them. On the contrary, if you have classic mode, even classic mode users can add documenting labels to their interfaces. And then commuting label mode users can use these labels to pass arguments in the order they prefer. The whole point is: the user (not the implementor) should decide. And in practice it is better to decide on a program-wide rather than a per-module basis (as some suggested). In extreme cases where you want to mix both modes in the same program, you can do it on a per-file basis. This is not encouraged, but there are well-defined semantics as long as you write a .mli file (or check types in the .cmi file). I really think that being able to switch in the middle of a file would be dangerous. I'm already sometimes confused by such uses of "open". The only weakness of this approach is if you copy some code from a file in classic mode to one in commuting label mode (or reverse). Then you have to add/remove labels by hand. But then this is also a way to understand the code better :-) It might also be possible to develop a tool to do that semi- automatically. In fact Jun Furuse has been asking for it for a long time, but I think he is big enough to be able to do it himself :-) Best regards, Jacques