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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 8D2BEBB81 for ; Thu, 23 Feb 2006 20:33:24 +0100 (CET) Received: from smtp6.wanadoo.fr (smtp6.wanadoo.fr [193.252.22.25]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1NJXOea021704 for ; Thu, 23 Feb 2006 20:33:24 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0609.wanadoo.fr (SMTP Server) with ESMTP id 2E940240011F for ; Thu, 23 Feb 2006 20:33:24 +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 DC43D2400115 for ; Thu, 23 Feb 2006 20:33:23 +0100 (CET) X-ME-UUID: 20060223193323902.DC43D2400115@mwinf0609.wanadoo.fr Message-ID: <00bd01c638b0$9eeefda0$1f570b50@mshome.net> From: =?iso-8859-1?Q?Fr=E9d=E9ric_Gava?= To: 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:37:45 +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 concorde with ID 43FE0E04.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; gava:01 gava:01 caml-list:01 val:01 12.:98 constructor:01 constructor:01 pair:01 tuples:01 immutable:01 argument:01 argument:01 int:01 int:01 semantic: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, And it does not justify why # type t=A of int*int type t = A of int * int # let a=2,3;; val a : int * int = (2, 3) # (A a);; The constructor A expects 2 argument(s), but is here applied to 1 argument(s) You have build "a" of type int * int which is the parameter of A and it is not good ;-( (I understand the idea of the difference that the constructor take n arguments or 1 argument of n values (i.e curryied or not) but despite that you could not write (A 1 2), I do not understand why there is a difference). For performance issues, is there a way to not have the rebuild of the pair in # type t = A of int*int | B of (int*int);; # fun x -> match x with A (a,b) -> (a,b) | B a -> a;; ? FG