From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 3B1A6BBAF for ; Fri, 30 May 2008 02:32:55 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkQBACDoPkjAXQIniGdsb2JhbACSKgEBAQ8gMZxy X-IronPort-AV: E=Sophos;i="4.27,563,1204498800"; d="scan'208";a="11308999" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 30 May 2008 02:32:54 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m4U0WqA3017115 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 30 May 2008 02:32:54 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsMDACDoPkg+TcsEXWdsb2JhbACSIBcFBggPNJxy X-IronPort-AV: E=Sophos;i="4.27,563,1204498800"; d="scan'208";a="12934393" Received: from b.relay.invitel.net ([62.77.203.4]) by mail1-smtp-roc.national.inria.fr with ESMTP; 30 May 2008 02:32:52 +0200 Received: from mail.invitel.hu (mail.invitel.hu [213.163.59.4]) by b.relay.invitel.net (Invitel Core SMTP Transmitter) with ESMTP id A992F31A6B0 for ; Fri, 30 May 2008 02:32:51 +0200 (CEST) Received: from ephubudl0046.budapest.epam.com ([93.92.56.245]) by mail.invitel.hu (Invitel Messaging Server) with ESMTPA id <0K1N0051LO6RSO60@invitel.hu> for caml-list@inria.fr; Fri, 30 May 2008 02:32:51 +0200 (CEST) Date: Fri, 30 May 2008 02:32:51 +0200 From: Adam Granicz Subject: Re: [Caml-list] syntax question In-reply-to: <483F2CEC.7020701@cs.caltech.edu> To: "caml-list@inria.fr" Message-id: MIME-version: 1.0 Content-type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 Content-transfer-encoding: 7BIT References: <483F2CEC.7020701@cs.caltech.edu> User-Agent: Opera Mail/9.24 (Win32) X-Miltered: at concorde with ID 483F4B34.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; syntax:01 foo:01 foo:01 0200,:01 vanier:01 mvanier:01 syntax:01 val:01 compiler:01 beginner's:01 ocaml:01 bug:01 beginners:01 wrote:01 clearer:01 Hi Michael, In the type definition > # type testme = Foo of int * int;; the constructor Foo takes *two* int arguments (thus, you can not construct a testme value supplying only one argument), whereas in > # type testme2 = Foo2 of (int * int);; it takes *one* tuple argument. Regards, Adam. On Fri, 30 May 2008 00:23:40 +0200, Michael Vanier wrote: > Hi everyone, > > I got bitten by a simple syntax problem: > > # let a = (1, 2);; > val a : int * int = (1, 2) > # type testme = Foo of int * int;; > type testme = Foo of int * int > # Foo a;; > The constructor Foo expects 2 argument(s), > but is here applied to 1 argument(s) > # Foo (1, 2);; > - : testme = Foo (1, 2) > # type testme2 = Foo2 of (int * int);; > type testme2 = Foo2 of (int * int) > # Foo2 a;; > - : testme2 = Foo2 (1, 2) > > Why does the compiler treat int * int and (int * int) in type > definitions so differently? Is it to give clearer error messages in the > typical case? > > Mike > > > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs