From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id DB824BB81 for ; Thu, 23 Feb 2006 20:20:18 +0100 (CET) Received: from smtp6.wanadoo.fr (smtp6.wanadoo.fr [193.252.22.25]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k1NJKIMS006588 for ; Thu, 23 Feb 2006 20:20:18 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0609.wanadoo.fr (SMTP Server) with ESMTP id 843F52400127 for ; Thu, 23 Feb 2006 20:20:18 +0100 (CET) Received: from nono (ARouen-106-1-3-31.w80-11.abo.wanadoo.fr [80.11.87.31]) by mwinf0609.wanadoo.fr (SMTP Server) with SMTP id 16DD42400115; Thu, 23 Feb 2006 20:20:17 +0100 (CET) X-ME-UUID: 20060223192018937.16DD42400115@mwinf0609.wanadoo.fr Message-ID: <00b001c638ae$cd11d240$1f570b50@mshome.net> From: =?iso-8859-1?Q?Fr=E9d=E9ric_Gava?= To: "David Brown" Cc: References: <006101c6389e$9bbbc440$1f570b50@mshome.net> <20060223185624.GA26907@old.davidb.org> Subject: Re: [Caml-list] (int * int) <> int*int ? Date: Thu, 23 Feb 2006 20:24:43 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Miltered: at nez-perce with ID 43FE0AF2.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; gava:01 gava:01 caml-list:01 compiler:01 constructors:01 12.:98 pair:01 tuples:01 immutable:01 int:01 int:01 semantic:02 tuple:02 match:02 guess:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=RCVD_IN_NJABL_PROXY autolearn=disabled version=3.0.3 > Because tuples are generally immutable, there is little semantic > difference, but the compiler does have to keep track of which is which. Thanks, but which differnce ? >In most cases I would guess that 'A' would be more efficient (unless there are > lots of larger constructors sharing the same tuple). Peraps in patter mathching: # type t = A of int*int | B of (int*int);; type t = A of int * int | B of (int * int) # fun x -> match x with A (a,b) -> (a,b) | B a -> a;; - : t -> int * int = where the case of B will be more efficient since the are not need to rebuild a pair Best, FG