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=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 1020CBC69 for ; Tue, 26 Jun 2007 02:15:31 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.230]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5Q0FUeG008927 for ; Tue, 26 Jun 2007 02:15:30 +0200 Received: by nz-out-0506.google.com with SMTP id s1so1298051nze for ; Mon, 25 Jun 2007 17:15:29 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=GLFZbOdLbp+F08S4ExC6czYJtA2EM113tgSeS/LXTE4Aw0CxENORR1CcCVaAgY99aNEAo3Q2VYy5Pq11t/L9oI6NO61QMqSRC7BzOIX9D7ahi+RZlAsIn4OZZK8EoieLi5HtMsM7C5Zuw7v7qkPN5RdECVneupHdMFOdrM9OF/g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Psp1Z2yVPhFh59MmVgV3k7A3sP9jEQj/vQGl7/SY2XiX/5OfMT/e7RKGyS7uX+6doADp00C5cJI541LkWrkhXMm87nRxBShOMLk272t6y7E9UOlp1RFqEND23bmOBHe+EBAJ1WaZfK9hDWBExqJ5CP39KYw4PppT6dWmn3o0qbo= Received: by 10.115.58.1 with SMTP id l1mr5907195wak.1182816929502; Mon, 25 Jun 2007 17:15:29 -0700 (PDT) Received: by 10.114.235.10 with HTTP; Mon, 25 Jun 2007 17:15:29 -0700 (PDT) Message-ID: <875c7e070706251715x61893212k62c9a15ce8e08989@mail.gmail.com> Date: Mon, 25 Jun 2007 20:15:29 -0400 From: "Chris King" To: "Jonathan Bryant" Subject: Re: [Caml-list] Execution time of class versus record Cc: "Jon Harrop" , caml-list@yquem.inria.fr In-Reply-To: <01BF21CB-3772-4642-8EA7-C18DA5A8F712@valdosta.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <467E8A6E.9050700@menta.net> <200706250425.28516.jon@ffconsultancy.com> <467FA3F8.2030601@lix.polytechnique.fr> <200706251307.16487.jon@ffconsultancy.com> <01BF21CB-3772-4642-8EA7-C18DA5A8F712@valdosta.edu> X-j-chkmail-Score: MSGID : 46805AA2.001 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46805AA2.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; afaik:01 wrote:01 partial:01 caml-list:01 int:01 int:01 tuple:02 tuple:02 match:02 pattern:04 matching:05 chris:06 chris:06 somewhere:06 identical:07 On 6/25/07, Jonathan Bryant wrote: > I've always been a little curious about this. Is performance the > _only_ reason for this distinction? Construction and pattern > matching on the two are identical, and AFAIK neither doesn't allow > partial application. Using the tupled form, you can pattern-match the tuple as a whole. E.g. # type t = A of (int * int);; # match A (1,2) with A x -> x;; int * int = (1, 2) This isn't allowed with the non-tupled form. Same goes for construction. (This is where the non-tupled form can actually cost you, if you need to pass around its arguments as a tuple somewhere.) - Chris