From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA17441 for caml-redistribution; Sun, 19 Dec 1999 22:43:59 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA19995 for ; Sat, 18 Dec 1999 18:59:13 +0100 (MET) Received: from shell5.ba.best.com (shell5.ba.best.com [206.184.139.136]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id SAA01906 for ; Sat, 18 Dec 1999 18:59:11 +0100 (MET) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.9.3/8.9.2/best.sh) with ESMTP id JAA06010; Sat, 18 Dec 1999 09:59:00 -0800 (PST) Date: Sat, 18 Dec 1999 09:59:00 -0800 (PST) From: Brian Rogoff To: skaller cc: caml-list@inria.fr Subject: Re: How do I .. In-Reply-To: <385B318A.76681803@maxtal.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis 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