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 A7336BBAF for ; Fri, 30 May 2008 00:23:50 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkEBAKnJPkjAXQIniGdsb2JhbACSKgEBAQ8gnW8 X-IronPort-AV: E=Sophos;i="4.27,563,1204498800"; d="scan'208";a="11305962" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 30 May 2008 00:23:50 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m4TMNj54013013 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 30 May 2008 00:23:50 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoEAABzKPkiD1+8Thmdsb2JhbACSKgEBAQoFBgcTBZ1q X-IronPort-AV: E=Sophos;i="4.27,563,1204498800"; d="scan'208";a="13232483" Received: from outgoing-mail.its.caltech.edu ([131.215.239.19]) by mail3-smtp-sop.national.inria.fr with ESMTP; 30 May 2008 00:23:49 +0200 Received: from water-dog.its.caltech.edu (water-dog [192.168.1.26]) by water-ox-postvirus (Postfix) with ESMTP id 3ECC41B73B for ; Thu, 29 May 2008 15:23:47 -0700 (PDT) Received: from [198.18.191.245] (unknown [208.110.0.2]) (Authenticated sender: mvanier) by earth-ox.its.caltech.edu (Postfix) with ESMTP id AD7451BC8F for ; Thu, 29 May 2008 15:23:44 -0700 (PDT) Message-ID: <483F2CEC.7020701@cs.caltech.edu> Date: Thu, 29 May 2008 15:23:40 -0700 From: Michael Vanier User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: caml-list@inria.fr Subject: syntax question Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 483F2CF1.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; vanier:01 mvanier:01 syntax:01 syntax:01 val:01 foo:01 foo:01 compiler:01 clearer:01 constructor:01 int:01 int:01 argument:02 argument:02 let:03 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