From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA00720; Thu, 29 Mar 2001 08:42:03 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 IAA00674 for ; Thu, 29 Mar 2001 08:42:01 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f2T6fwH16645 for ; Thu, 29 Mar 2001 08:41:59 +0200 (MET DST) Received: from localhost (isdnppp2.kurims.kyoto-u.ac.jp [130.54.16.103]) by kurims.kurims.kyoto-u.ac.jp (8.9.3/3.7W) with ESMTP id PAA09819; Thu, 29 Mar 2001 15:41:42 +0900 (JST) To: mattias.waldau@abc.se, caml-list@inria.fr Subject: RE: [Caml-list] Future of labels In-Reply-To: References: <20010329094438J.garrigue@kurims.kyoto-u.ac.jp> X-Mailer: Mew version 1.94.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20010329154357G.garrigue@kurims.kyoto-u.ac.jp> Date: Thu, 29 Mar 2001 15:43:57 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: "Mattias Waldau" > Could you plz post a good argument for commuting labels. > > Even if we have optional arguments, we could require that the > arguments should be given in the correct order, and that > optionals may be skipped. Should I understand this as support for the classic mode ? This is exactly what it allows/requires. In fact it also allows commutation between optional arguments, which I believe is not only useful but necessary, when you think that some library functions have more than 10 optional arguments, and nobody wants to remember their order. Compare with the pain they are in emacs lisp. Commuting for non-optional arguments is another problem. I'm not sure I can give very convincing arguments, except for functions that have more than 5 parameters, and were again you don't want to remember their order. To be more precise, order alone is not enough to remember the role of the arguments, and you probably don't want to have to remember both name and order: one should be enough. Since most functions have less than 5 non-optional arguments, this is mostly a question of taste. I program always in this style, very often permuting parameters in functionals. One specific advantage is with respect to partial application: when defining a function you don't have to carefuly design the parameter order to allow many partial applications, since you can partially apply in any order. If you want to have an idea of what it looks like, see the sources for ocamlbrowser in otherlibs/labltk/browser. This is not very refined code, but it uses commutation a lot. Last, the concept of having everything commute is neat. Once you've started to put enough labels, you really don't have to care about parameter order anymore, at all. Does this answer you question ? --------------------------------------------------------------------------- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp JG ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr