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 AAA01678; Wed, 11 Apr 2001 00:01:38 +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 AAA01685 for ; Wed, 11 Apr 2001 00:01:37 +0200 (MET DST) Received: from miss.wu-wien.ac.at (miss.wu-wien.ac.at [137.208.107.17]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f3AM1Zb06525 for ; Wed, 11 Apr 2001 00:01:36 +0200 (MET DST) Received: (from mottl@localhost) by miss.wu-wien.ac.at (8.9.0/8.9.0) id AAA29260; Wed, 11 Apr 2001 00:01:31 +0200 (MET DST) Date: Wed, 11 Apr 2001 00:01:31 +0200 From: Markus Mottl To: John Max Skaller Cc: caml-list@inria.fr Subject: Re: [Caml-list] Future of labels Message-ID: <20010411000131.A25566@miss.wu-wien.ac.at> References: <20010329094438J.garrigue@kurims.kyoto-u.ac.jp> <20010329114640.A18984@miss.wu-wien.ac.at> <3AD11034.E9210A65@ozemail.com.au> <20010409104520.A5091@miss.wu-wien.ac.at> <3AD35413.FBF92146@ozemail.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3AD35413.FBF92146@ozemail.com.au>; from skaller@ozemail.com.au on Wed, Apr 11, 2001 at 04:42:27 +1000 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 11 Apr 2001, John Max Skaller wrote: > Markus Mottl wrote: > Doesn't this simply suggest that the library author should not > se labels on functions with a small number of obvious arguments? Right, but it also suggests that you as the library user shouldn't place labels on your functions if you intend to use them as arguments to unlabelled ones. This already reduced the number of labels quite significantly. > > But functions can be designed in a way such that positions will usually > > match. > > As I understand it, this will still work in commuting labelled > mode by using labels more sparingly when defining functions. Right again. So having labels all over the place is probably not very advisable... > > But I don't care about the benefits of commutation if the label names > > don't match. > > This problem is no different from the same problem > applying a functor. The names in the functor signature must match > the argument. If they don't you have to 'remap' them by defining > another module. True, but I am not sure whether this is the same problem. It is usually the case that modules are developed to match the signature of functor arguments if they are supposed to be applied in this way. People define many more functions than functors, using them in much more flexible ways. > > In this case (which is, I fear, the usual one) I'll have > > to write out all arguments and label names _anyhow_. > > let f x y = y in > fold_left f x l > > works in commuting label mode if fold_left is defined without labels. But it won't work if _f_ has arguments with labels! This is the problem that I find annoying, because it prevents me from labelling functions if they are supposed to be used with both fold_left and in other contexts. > On the other hand: > > w#set_press (fun ~x ~y ~time ~ctrl ~shift -> ... ) > > is fine for the set_press GUI function which accepts a callback > with a lot of arguments. Aren't we arguing about how much labelling > to do in a library, rather than whether using the labels _if provided_ > should be mandatory? In the moment you use labels you force everybody else to use the same label names. Not using labels at the call site is not an option, it's mandatory (in label mode) if the definition also uses labels. The same is true vice versa: if the library doesn't use labels, you also must not use them or you have to work around it. Regards, Markus Mottl -- Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr