caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <Damien.Doligez@inria.fr>
To: caml-list@inria.fr
Subject: Re: Syntax for label, NEW PROPOSAL
Date: Fri, 17 Mar 2000 22:33:59 +0100	[thread overview]
Message-ID: <200003172133.WAA16479@tobago.inria.fr> (raw)

First of all, I don't think I'm going to use label mode anytime soon,
but the same is true of objects, I haven't looked at variants yet, and
I consider higher-order functors an exotic feature that I'll probably
never need (and I do use double-semicolons).

But that's no reason to go to war against labels.  It's just I'm in
love with the small simple functional language that is at the heart of
O'Caml. As long as I can use it, I'm happy.

Now a few random comments on the discussion.


>From: Don Syme <dsyme@microsoft.com>
>  - No labels inside the arguments of higher order functions.  This 
>    will really confuse new users who try not to use labels!
>    e.g.. no "acc" in the first argument of
>       val fold_right: fun:('b -> acc:'a -> 'a) -> 'b array -> acc:'a -> 'a

But that argument doesn't really work because new users who try not
to use labels will not use label mode.


>o The "just documentation" response doesn't really hold water,
>because if the labels were just documentation, then they would
>different.  For example, "fun", being a keyword, is highly confusing
>and not terribly descriptive - any sensible prototype would probably
>just use "f".

I agree, and I would even go further.  I think the current labeling of
the standard library is way too verbose.  "fun" should not be "func"
or even "fn", but simply "f".  That's the usual name for a generic
function.  Likewise, we should replace char:char with c:char and so
on (maybe even the predicate function in List.for_all should be
labeled f).

Also, in the List module, I found this:

    val nth : 'a list -> pos:int -> 'a

This is really bad design, unless the goal is to confuse the reader
(two different names for the same number).  It should be either

    val nth : 'a list -> n:int -> 'a

or

    val posth : 'a list -> pos:int -> 'a
.

I think we need to develop a systematic set of abbreviations (and a
document to explain it) that will allow us to limit almost all labels
to be at most one character in length.  It would (at least partially)
solve the problem of expression cluttering that we have with the long
labels currently in the library.  As a side-effect, it would also
solve the problem of keywords as labels: there isn't any keyword of
length 1.


>From: Dave Mason <dmason@sarg.Ryerson.CA>
>1) please do not call it ``modern'' mode.  Call it ``label'' mode.

This is an excellent suggestion, and I have implemented it (as of
version 2.99+12) : I replaced the command-line option "-modern" with
"-label".  I kept "-modern" as an alias to "-label" for the time
being, but I certainly hope we'll retire it before we release 3.00.

-- Damien



             reply	other threads:[~2000-03-18 17:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-17 21:33 Damien Doligez [this message]
2000-03-18 21:07 ` Frank Atanassow
2000-03-18 22:40 ` John Prevost
  -- strict thread matches above, loose matches on Subject: below --
2000-03-17 17:03 Don Syme
2000-03-17 19:24 ` John Prevost
2000-03-15 20:40 Don Syme
2000-03-17  9:48 ` Jacques Garrigue
2000-03-17 17:34   ` Dave Mason
2000-03-18  0:26     ` Jacques Garrigue
2000-03-23 13:07       ` Sven LUTHER
2000-03-14 16:53 Syntax for label Don Syme
2000-03-15  3:15 ` Syntax for label, NEW PROPOSAL Jacques Garrigue
2000-03-15  6:58   ` Christophe Raffalli
2000-03-15 21:54     ` Julian Assange
2000-03-15 11:56   ` Wolfram Kahl
2000-03-15 13:58   ` Pierre Weis
2000-03-15 15:26     ` Sven LUTHER
2000-03-17  7:44       ` Pierre Weis
2000-03-15 17:04     ` John Prevost
2000-03-17 10:11       ` Jacques Garrigue
2000-03-15 17:06     ` Markus Mottl
2000-03-15 19:11     ` Remi VANICAT
2000-03-17  8:30       ` Pierre Weis
2000-03-17 14:05         ` Jacques Garrigue
2000-03-17 16:08           ` Pierre Weis
2000-03-15 21:30     ` John Max Skaller
2000-03-16  2:55     ` Jacques Garrigue
2000-03-17 15:13       ` Pierre Weis
2000-03-17 17:33         ` Wolfram Kahl
2000-03-18 11:59         ` Jacques Garrigue
2000-03-21 16:51       ` Pascal Brisset
2000-03-23 11:14         ` Nicolas barnier
2000-03-16  8:50     ` Pascal Brisset
2000-03-17 11:15       ` Sven LUTHER

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=200003172133.WAA16479@tobago.inria.fr \
    --to=damien.doligez@inria.fr \
    --cc=caml-list@inria.fr \
    /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).