caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@best.com>
To: skaller <skaller@maxtal.com.au>
Cc: caml-list@inria.fr
Subject: Re: How do I ..
Date: Sat, 18 Dec 1999 09:59:00 -0800 (PST)	[thread overview]
Message-ID: <Pine.BSF.4.21.9912180941460.29900-100000@shell5.ba.best.com> (raw)
In-Reply-To: <385B318A.76681803@maxtal.com.au>

On Sat, 18 Dec 1999, skaller wrote:

> I'm confused:
> 
>        Objective Caml version 2.99 (99/12/08)
> 
> # let f (lx:x : int) = x + 1;;
> Syntax error

Try "#modern true;;" at the top level, or compile with the -modern switch. 

I hope this modern/classic mode distinction is just a temporary thing. 

> Here, I have an argument x, a label lx, and a type declaration int.
> What's the error? Can't I both label an argument, and also type it?

Modern mode handles it. I would have thought classic mode would too, since
you're not reordering arguments, but I see that's not the case. Explanation
anyone?

> The whitespace rule is a bit weird .. but it makes some sense,
> when compared with 'a for a type variable: the ' must come
> right in front of the a, with no white space, so I guess
> I can live with lablx:x as a labelled argument .. :-)
> 
> At first, I got really confused by the difference between
> a label, and the name of the argument. Until I realised,
> you can't use the name of the argument as a label, because
> it would imply all arguments were labelled. In the tutorial,
> it would be nice to replace ambiguous examples like:
> 
> 	let f x:x ... 

I think that the label is "x:" and the argument name is "x", with the 
sugar that :x is equivalent to x:x. At least that's how I interpreted 
the rules.

-- Brian




  reply	other threads:[~1999-12-19 21:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-18  7:02 skaller
1999-12-18 17:59 ` Brian Rogoff [this message]
1999-12-20 11:06   ` Jacques Garrigue
1999-12-20 20:16     ` Brian Rogoff
1999-12-21 17:39       ` Jacques Garrigue
1999-12-18 18:09 ` David Brown
1999-12-18 17:41 Juergen Pfitzenmaier

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=Pine.BSF.4.21.9912180941460.29900-100000@shell5.ba.best.com \
    --to=bpr@best.com \
    --cc=caml-list@inria.fr \
    --cc=skaller@maxtal.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).