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 PAA16204 for caml-redistribution@pauillac.inria.fr; Tue, 21 Mar 2000 15:28:06 +0100 (MET) Resent-Message-Id: <200003211428.PAA16204@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 FAA23182 for ; Sun, 19 Mar 2000 05:39:19 +0100 (MET) Received: from shell5.ba.best.com (shell5.ba.best.com [206.184.139.136]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id FAA12049 for ; Sun, 19 Mar 2000 05:39:17 +0100 (MET) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.9.3/8.9.2/best.sh) with ESMTP id UAA03643; Sat, 18 Mar 2000 20:39:13 -0800 (PST) Date: Sat, 18 Mar 2000 20:39:13 -0800 (PST) From: Brian Rogoff To: Jan Brosius cc: caml-list@inria.fr Subject: Re: to have labels or not In-Reply-To: <000901bf9047$45886e30$0706bed4@jannt> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-From: weis@pauillac.inria.fr Resent-Date: Tue, 21 Mar 2000 15:28:06 +0100 Resent-To: caml-redistribution@pauillac.inria.fr On Fri, 17 Mar 2000, Jan Brosius wrote: > My personal choice is not to use labels at all because it makes the readable > code too big, it is better I think to use meaningful words and within > comments to clarify the types of the functions. I don't believe this argument. I got the labeled and nonlabeled versions of Markus Mottl's PCRE library and looked at their respective sizes; the labeled versions had significantly less code (10-20% I think) than the unlabeled. It also dealt better with that name mess caused by optional parameters in the old PCRE interface causing it to read better IMO. I agree that labels seem heavy for some uses, and depending on your coding style they may not be for you. Making the labels single letter names seems like a bad idea. How do we distinguish "file" and "function" for example? I like "fn" but "func" is OK too. I like ":", and I'm not sure I want to give up $, %, or & for labels. Its nice to be able to use these as infixes, whether or not infixes are good for programming-in-the-large. I also agree that the error messages are difficult, but that's orthogonal to labels, call it the "price of type inference". Whatever happened to those other O'Labl features that haven't made it into OCaml yet? In particular, polymorphic methods. > I think I would never use the "label on " option. Never say never. > function x -> .. could be shortened by : \x ->..... I think and the use > of [`a] instead of `a list and the use of list comprensions as in Haskell > could shorten the readable code and maintain readability. Actually `a is another issue, and elsewhere it was rightly suggested that it be made illegal ;-). OK, seriously, you can use CamlP4 to get comprehension syntax, and but it doesn't work yet with labels so you won't have a chance to try them if you need P4. -- Brian