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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 67D1DBB81 for ; Fri, 13 Jan 2006 08:56:48 +0100 (CET) Received: from ash25e.internode.on.net (ash25e.internode.on.net [203.16.214.182]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0D7uk9R029279 for ; Fri, 13 Jan 2006 08:56:47 +0100 Received: from rosella (ppp33-253.lns1.syd2.internode.on.net [59.167.33.253] (may be forged)) by ash25e.internode.on.net (8.13.5/8.13.5) with ESMTP id k0D7uXL5079188; Fri, 13 Jan 2006 18:26:34 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] Mixing variant types... From: skaller To: Jacques Garrigue Cc: caml-list@yquem.inria.fr In-Reply-To: <20060113.135716.226786926.garrigue@math.nagoya-u.ac.jp> References: <20060112.122230.45186948.garrigue@math.nagoya-u.ac.jp> <1137038225.3681.178.camel@rosella> <20060113.135716.226786926.garrigue@math.nagoya-u.ac.jp> Content-Type: text/plain Date: Fri, 13 Jan 2006 18:56:32 +1100 Message-Id: <1137138992.3681.462.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 43C75D3E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 argg:01 otherlibs:01 threads:01 otherlibs:01 systhreads:01 -thread:01 covariance:01 bug:01 wrote:01 sourceforge:01 sourceforge:01 compile:01 compile:01 argument:01 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 On Fri, 2006-01-13 at 13:57 +0900, Jacques Garrigue wrote: > From: skaller >> (* event.ml *) >> type +'a event = >> Communication of 'a behavior >> | Choose of 'a event list >> | WrapAbort of 'a event * (unit -> unit) >> | Guard of (unit -> 'a event) > The + above is not needed (it is implied by the definition) But it would fail if the type is not in fact covariant in its argument? > You still need to coerce the resulting list: > (List.map (fun w -> receive w.control) !windows :> ws_event list) Still doesn't seem to work: OUCH! Yes it DOES. Argg.. I modified otherlibs/threads/event.* but I didn't modify otherlibs/systhreads/event.* So when I compile with -thread it doesn't work. But when I compile with -vmthread it does work. Which is pretty conclusive proof the patch does work in at least one case. And if I'm right, the + in the implementation proves covariance mechanically so it should be safe. Should I add a feature request to the bug tracker? -- John Skaller Felix, successor to C++: http://felix.sf.net