caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Markus Mottl <mottl@miss.wu-wien.ac.at>
To: John Max Skaller <skaller@ozemail.com.au>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Future of labels
Date: Wed, 11 Apr 2001 00:01:31 +0200	[thread overview]
Message-ID: <20010411000131.A25566@miss.wu-wien.ac.at> (raw)
In-Reply-To: <3AD35413.FBF92146@ozemail.com.au>; from skaller@ozemail.com.au on Wed, Apr 11, 2001 at 04:42:27 +1000

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


  reply	other threads:[~2001-04-10 22:01 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-29  0:44 Jacques Garrigue
     [not found] ` <AAEBJHFJOIPMMIILCEPBEEFHCHAA.mattias.waldau@abc.se>
2001-03-29  6:43   ` Jacques Garrigue
2001-03-29 11:44     ` Mattias Waldau
2001-03-29 17:52     ` Mattias Waldau
2001-03-29  8:22 ` Chris Hecker
2001-03-29  9:46 ` Markus Mottl
2001-04-09  1:28   ` John Max Skaller
2001-04-09  8:33     ` [Caml-list] Indexed and optional arguments (was Future of labels) Jacques Garrigue
2001-04-10 18:23       ` [Caml-list] " John Max Skaller
2001-04-09  8:45     ` [Caml-list] Future of labels Markus Mottl
2001-04-10 18:42       ` John Max Skaller
2001-04-10 22:01         ` Markus Mottl [this message]
2001-03-29 12:53 ` Judicael Courant
2001-03-30  3:42   ` [Caml-list] Implicit parameters (was Future of labels) Jacques Garrigue
2001-03-30  7:55     ` Markus Mottl
2001-03-29 19:56 [Caml-list] Future of labels Manuel Fahndrich
2001-03-30  3:01 ` Jacques Garrigue
2001-03-30  8:23   ` Markus Mottl
2001-03-30  9:45   ` kahl
2001-03-30 10:43     ` Jacques Garrigue
2001-03-30 12:32       ` Benjamin C. Pierce
2001-03-30 10:39   ` Judicael Courant
2001-03-30 10:54     ` Jacques Garrigue
2001-03-30 11:22   ` Francois Pottier
2001-03-30 12:41     ` Benjamin C. Pierce
2001-03-30 14:16       ` Jean-Marc Alliot
2001-03-29 23:47 Arturo Borquez
     [not found] <200103300810.AAA05312@mrs.mrs.med.ge.com>
2001-03-30 10:31 ` Jacques Garrigue
2001-03-31  3:40 Yaron M. Minsky
2001-04-11  3:35 G Michael Sawka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010411000131.A25566@miss.wu-wien.ac.at \
    --to=mottl@miss.wu-wien.ac.at \
    --cc=caml-list@inria.fr \
    --cc=skaller@ozemail.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).