From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 8C022BB81 for ; Mon, 20 Dec 2004 12:50:28 +0100 (CET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBKBoQBI013599 for ; Mon, 20 Dec 2004 12:50:27 +0100 Received: from [192.168.1.200] (ppp194-89.lns1.syd2.internode.on.net [203.122.194.89]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id iBKBoDGa062113; Mon, 20 Dec 2004 22:20:14 +1030 (CST) Subject: Re: [Caml-list] Type problem... possible design problem From: skaller Reply-To: skaller@users.sourceforge.net To: "chris.danx" Cc: Jon Harrop , caml-list@yquem.inria.fr In-Reply-To: <41C43E79.1040502@ntlworld.com> References: <41C37CF7.5050400@ntlworld.com> <200412180807.05925.jon@jdh30.plus.com> <41C43E79.1040502@ntlworld.com> Content-Type: text/plain Organization: Message-Id: <1103543412.5079.67.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 20 Dec 2004 22:50:12 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41C6BC82.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sourceforge:01 wrote:01 variants:01 subgraphs:01 glebe:01 ...:98 061:98 nsw:01 constructor:01 constructor:01 argument:01 snail:02 2037:02 match:02 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: On Sun, 2004-12-19 at 01:28, chris.danx wrote: > My concern with variants is sharing subgraphs in graphs, will they be > shared or copied? It is up to you. Consider: match ex with | `A a -> `A a | (`B b ) as x -> x | x -> x In the first case, you're making a new object, by executing the constructor `A. In the second and third you're not. In all cases, the constructor argument is shared. -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net