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 352E2BB81 for ; Thu, 23 Feb 2006 21:15:54 +0100 (CET) Received: from cenn.mc.mpls.visi.com (cenn.mc.mpls.visi.com [208.42.156.9]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k1NKFrXK025853 for ; Thu, 23 Feb 2006 21:15:53 +0100 Received: from [192.168.42.2] (bhurt.dsl.visi.com [208.42.141.66]) by cenn.mc.mpls.visi.com (Postfix) with ESMTP id 7629B82D9; Thu, 23 Feb 2006 14:15:52 -0600 (CST) Date: Thu, 23 Feb 2006 14:15:53 -0600 (CST) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: =?iso-8859-1?Q?Fr=E9d=E9ric_Gava?= Cc: caml-list@yquem.inria.fr, Eric Cooper Subject: Re: [Caml-list] (int * int) <> int*int ? In-Reply-To: <009b01c638ac$6a57b0e0$1f570b50@mshome.net> Message-ID: References: <006101c6389e$9bbbc440$1f570b50@mshome.net> <20060223183306.GA17390@localhost> <009b01c638ac$6a57b0e0$1f570b50@mshome.net> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-1003719369-1140725753=:9569" X-Miltered: at concorde with ID 43FE17F9.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 gava:01 runtime:01 indirection:01 parens:01 int-:01 int-:01 indirection:01 wrote:01 int:01 int:01 readable:02 tuple:02 tuple:02 unreadable:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1003719369-1140725753=:9569 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 23 Feb 2006, Fr=E9d=E9ric Gava wrote: >> # type t=3DA of int*int and t'=3D B of (int*int);; >> type t =3D A of int * int >> and t' =3D B of (int * int) >> See section 18.3.4 of the manual -- the distinction allows the runtime >> representation of t to avoid a level of indirection. > > Thanks for your anwser but I am not convinced that is a good reason. If "= t" > is better why " t' " is not automatically tranform into "t" (it is easy, = you > just delete the global parens). ok (int->int)->int <> int->int->int or > int*int*int<>int*(int*int) . Morever I think that int*int=3D(int*int) > "everywhere" in ML... This isn't correct- the same problem shows up in the difference between: int*int*int and int*(int*int)- i.e. the difference between (1,2,3) and=20 (1,(2,3)). In the first case (in both examples) I have a three element=20 tuple, in the second case I have a two element tuple whose second element= =20 is also a two element tuple (and thus I have the layer of indirection). Also, sometimes I want one and sometimes I want the other. I can often=20 save copying information (and storing the duplicate information) if I can= =20 add the level of indirection- this is important if I'm copying the=20 information a lot. On the other hand, if the information isn't being=20 duplicated a lot, then I can save memory by not having the extra level of= =20 indirection. Brian --8323328-1003719369-1140725753=:9569--