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.0 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 7494CBC69 for ; Sat, 24 Feb 2007 14:43:27 +0100 (CET) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.191]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1ODhQKj032461 for ; Sat, 24 Feb 2007 14:43:27 +0100 Received: by mu-out-0910.google.com with SMTP id w9so707425mue for ; Sat, 24 Feb 2007 05:43:26 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=q8kUA7wZK4eC3aUqmUXGORYaHZ8Co4w/5K8uJ7wLiNjxbRAdFBeW+t/1RP9g+pIiLLi2pvTA5ORTxLLpGmJaKToqcxaExtO2CGBz2qAlJ3q6DcvesDVT+rvM1WC12k2Sk04UwEbNpe7bp8q2Z+FtN8tyYYEyudR8OUIAuQcfIA4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=t/FmTs6a6PFhILtDcYzhcp2EDJzll2vFYpkDlFzpDKcwB+e5//988uIZ/a3EQgdRBAq1MylzJ/o56dllYZrJn0d1c91T+I7KV3r2aoTEWBgxGIW9yzPZdyIbBx/10tXv1S0VHzscdwSScpjK84D1QyQv0k4g6kHstd7rnFY64p4= Received: by 10.82.148.7 with SMTP id v7mr1035876bud.1172324606688; Sat, 24 Feb 2007 05:43:26 -0800 (PST) Received: by 10.82.134.14 with HTTP; Sat, 24 Feb 2007 05:43:26 -0800 (PST) Message-ID: <4a708d20702240543w4c9d0a91tb12c13b10254a68b@mail.gmail.com> Date: Sat, 24 Feb 2007 14:43:26 +0100 From: "Lukasz Stafiniak" To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Feature request : Tuples vs. records In-Reply-To: <4a708d20702230832m4e143586i6036980ead10042a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7639252.205431172158497978.JavaMail.www@wwinf2216> <45DDC1CB.2090401@ens-lyon.org> <200702230145.55947.jon@ffconsultancy.com> <4a708d20702230832m4e143586i6036980ead10042a@mail.gmail.com> X-j-chkmail-Score: MSGID : 45E040FF.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45E040FF.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lukasz:01 lukasz:01 variants:01 variants:01 polymorphism:01 polymorphic:01 wrote:01 wrote:01 caml-list:01 tuples:01 tuples:01 tuple:02 tuple:02 pattern:04 modify:05 On 2/23/07, Lukasz Stafiniak wrote: > On 2/23/07, Jon Harrop wrote: > > On Thursday 22 February 2007 16:16, David Teller wrote: > > > I'm more concerned about having to > > > * declare every record type I use -- that looks to me clumsy and Java-like > > > * differenciate between records and tuples during pattern-matching > > > > The same can be said of ordinary and polymorphic variants. You must declare > > ordinary variants. You must distinguish between the two in patterns. > > I have this idea... We could have row polymorphism in tuples, without any impact on performance! Instead of insisting that ('a * 'b) means exactly two elements, we could have (> 'a * 'b) at least two elements. Any projections or pattern matching fetches the tuple fields without problems: it doesn't need to care that there are more than it needs. Say you realize that you need to return another value from a function (which already returns a tuple): you would only modify the function and not its uses.