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 TAA14455; Thu, 29 Mar 2001 19:52:42 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 TAA14449 for ; Thu, 29 Mar 2001 19:52:40 +0200 (MET DST) Received: from tor.abc.se (ns.abc.se [195.17.72.11]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f2THqP903182 for ; Thu, 29 Mar 2001 19:52:25 +0200 (MET DST) Received: from gateway (dialup-32 [195.17.73.32]) by tor.abc.se (8.9.3+Sun/8.9.3) with SMTP id TAA19480 for ; Thu, 29 Mar 2001 19:52:24 +0200 (MET DST) From: "Mattias Waldau" To: Subject: RE: [Caml-list] Future of labels Date: Thu, 29 Mar 2001 19:52:23 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 In-Reply-To: <20010329154357G.garrigue@kurims.kyoto-u.ac.jp> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk In my previous job we used Visual Basic a lot. VB has labels. Our coding standards required us to use labels whenever two arguments had the same type, for example 2 string-arguments. This makes reading of the code very easy, and reduces the risk of stupid bugs due to wrong order of arguments. As I see it, the main advantage of labels is readbility. I also think the way that Ocaml does it is very good, VB for example would require you to write 'f tree:=tree', whereas in Ocaml just writes 'f ~tree' to the function 'let f ~tree = ...'. Less to write which makes programs more compact and still readable. As I see it Advantages with 'classic mode': - simpler, both for language implementor, emacs-mode implementors, and for users (less to explain) - more compatible with non-label code Advantages with 'commuting mode' - You don't have to remember the order - You partially apply on any argument I would say that the arguments for 'commuting mode' are very weak. I can't value the possibility of being able to partially apply on any argument. I would just create a anonymous function that would change the order of the arguments (which would be very readable). To not have to remember the order is only an argument if you use a less capable IDE like Emacs. All modern IDE's will automatically show the argument list when you enter the function name, and thus you don't have to remember the arguments, nor their order. It would be very easy to make such a mode for Emacs for Ocaml, especially since you only have to look in the file itself before the current point, and in mli-files that are 'Open'. Maybe this mode already exists, I only use the standard mode today, since I had problems with other modes on Windows. If so, plz let me know. /mattias ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr