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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 1D9F1BC69 for ; Fri, 23 Feb 2007 03:58:34 +0100 (CET) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1N2wX9w030510 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 23 Feb 2007 03:58:33 +0100 Received: from [80.229.56.224] (helo=beast.local) by ptb-relay02.plus.net with esmtp (Exim) id 1HKQdk-0002Ii-JA for caml-list@yquem.inria.fr; Fri, 23 Feb 2007 02:58:33 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Feature request : Tuples vs. records Date: Fri, 23 Feb 2007 01:45:55 +0000 User-Agent: KMail/1.9.5 References: <7639252.205431172158497978.JavaMail.www@wwinf2216> <45DDC1CB.2090401@ens-lyon.org> In-Reply-To: <45DDC1CB.2090401@ens-lyon.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702230145.55947.jon@ffconsultancy.com> X-Miltered: at concorde with ID 45DE5859.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; variants:01 variants:01 structurally:01 inference:01 ocaml:01 ocaml:01 frog:98 polymorphic:01 polymorphic:01 wrote:01 typing:01 caml-list:01 tuples:01 tuples:01 essentially:02 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. Similarly, polymorphic variants (that are structurally typed and provide more inference) weaken the type system. The main disadvantage of this is in reporting errors, which become prohibitively obfuscated. > * having to learn/teach two different implementations of what is > essentially the same concept Although tuples and records are both product types, I think people have cited several fundamental differences between them: typing, performance, robustness etc. > * having to learn/teach that third meaning of operator = (the first one > being comparison between values and the second one being its use in let > x = ...). You would rather teach another use of ":"? -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. OCaml for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists