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=AWL 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 7505FBBAF for ; Fri, 30 May 2008 09:06:25 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgECAK9EP0jAXQIniGdsb2JhbACSKgEBAQ8gnDY X-IronPort-AV: E=Sophos;i="4.27,565,1204498800"; d="scan'208";a="11320193" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 30 May 2008 09:06:25 +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 m4U76Okn027188 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 30 May 2008 09:06:25 +0200 From: luc.maranget@inria.fr (Luc Maranget) X-IronPort-AV: E=Sophos;i="4.27,565,1204498800"; d="scan'208";a="12947499" Received: from yquem.inria.fr ([128.93.8.37]) by mail1-relais-roc.national.inria.fr with ESMTP; 30 May 2008 09:06:24 +0200 Received: by yquem.inria.fr (Postfix, from userid 18041) id DE545BBAF; Fri, 30 May 2008 09:06:24 +0200 (CEST) Date: Fri, 30 May 2008 09:06:24 +0200 To: Michael Vanier Cc: Adam Granicz , "caml-list@inria.fr" Subject: Re: [Caml-list] syntax question Message-ID: <20080530070624.GC22257@yquem.inria.fr> References: <483F2CEC.7020701@cs.caltech.edu> <483F54A5.4020808@cs.caltech.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <483F54A5.4020808@cs.caltech.edu> User-Agent: Mutt/1.5.9i X-Miltered: at concorde with ID 483FA771.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; maranget:01 maranget:01 syntax:01 afaik:01 ocaml:01 foo:01 foo:01 constructors:01 syntax:01 semantics:01 constructors:01 curried:01 notation:01 --luc:01 luc:01 > Adam, > > I realize that this is how it works, but I don't understand why it should > work this way. AFAIK elsewhere in ocaml "int * int" always refers to a > tuple. Similarly, if testme's Foo really took two int arguments I would > expect to be able to create Foos as "Foo 1 2" instead of "Foo (1, 2)" which You understanding of constructors is correct : they take n arguments. Yes, the concrete syntax does not properly reflect the underlying semantics, with its fake tuple. Why is this so ? Why ask ? In case you are just curious, it can probably be tracked back to the original Caml where constructors took 0 or 1 arguments, and where tuples were primitive. Now, this is so for historical reasons and we live with it. Alternatives can be considered, best of which probably is the curried notation. But it is much too late to change that (but as pointed by others, there is an alternative, "revised", syntax). > > Mike > --Luc