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 QAA15856; Wed, 11 Apr 2001 16:02:27 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA15843 for caml-list@pauillac.inria.fr; Wed, 11 Apr 2001 16:02:26 +0200 (MET DST) 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 UAA31689 for ; Tue, 10 Apr 2001 20:42:53 +0200 (MET DST) Received: from localhost.localdomain (kenny78.zip.com.au [61.8.18.206]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f3AIgkb04196 for ; Tue, 10 Apr 2001 20:42:50 +0200 (MET DST) Received: from ozemail.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id EAA05759; Wed, 11 Apr 2001 04:42:27 +1000 Message-ID: <3AD35413.FBF92146@ozemail.com.au> Date: Wed, 11 Apr 2001 04:42:27 +1000 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Markus Mottl CC: Jacques Garrigue , caml-list@inria.fr Subject: Re: [Caml-list] Future of labels 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Markus Mottl wrote: > Even if it seems right that labels scale better on functions that have > many arguments (especially for ones of same type), we shouldn't neglect > the fact that such functions are much, much rarer, both as definition > and as application. We should certainly also consider statistical > (information theoretic) aspects of the "OCaml-channel" when trying to > find an "optimal code". Doesn't this simply suggest that the library author should not se labels on functions with a small number of obvious arguments? > 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. > 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. > 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. 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? > I don't know whether you are speaking of label mode, which I don't know > too well. With classic mode I don't find it so difficult: if I use any > non-optional argument that comes after the default arguments, they will > be bound to their defaults. In C++, defaults are given at the _end_ of the parameter list. In Ocaml, they go at the beginning. This is confusing. :-) -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 checkout Vyper http://Vyper.sourceforge.net download Interscript http://Interscript.sourceforge.net ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr