caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* RE: [Caml-list] Future of labels
@ 2001-03-29 19:56 Manuel Fahndrich
  2001-03-30  3:01 ` Jacques Garrigue
  0 siblings, 1 reply; 17+ messages in thread
From: Manuel Fahndrich @ 2001-03-29 19:56 UTC (permalink / raw)
  To: caml-list


I use label in classic mode, mostly to disambiguate arguments of the
same type and a little bit for documentation.

To see if I could do with modern mode, I tried to compile my current
code base with -modern. This seems to not be too bad, except for 2
things, one being a show stopper:

1) The standard library requires ~f: labels on many function arguments.
That seems silly. I basically had to add ~f: to many places where it did
not add disambiguation (f is not a very explicit name). I can see that
for partial applications that might be useful, but still I found this a
bit annoying.

2) If some library function requires a function argument with labeled
arguments, such as Map.fold f:(key:key -> data:'a -> 'b -> 'b)
and I happen to have a function around that would do the right fold
operation, except that it is unlabeled or has different labels, then I'm
stuck. I have to write an eta conversion. Why isn't an explicit cast to
change the labels of a function sound? I tried that and it didn't work.

Other than the above, it seems that a casual user like me could move
from classic to modern, especially if there are some further benefits
like partial applications in different orders.  One thing that needs
improvement though are the error messages. Because the compiler tries to
reorder arguments etc., forgetting a label spits out really whacky
messages like, this function expects too many arguments.

-Maf
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2001-04-09 15:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-31 21:52         ` [Caml-list] ocamlbrowser [was labels] Brock
     [not found]           ` <27280.986075478@saul.cis.upenn.edu>
2001-04-01  9:28             ` [Caml-list] " Jacques Garrigue
2001-04-01 21:16               ` Benjamin C. Pierce
2001-04-03 17:43                 ` Francisco Valverde Albacete
2001-04-04  7:56                   ` Michael Hicks
2001-04-09  4:43                 ` John Max Skaller
2001-03-30 10:39   ` [Caml-list] Future of labels 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

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).