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.1 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 4ABBFBC0A for ; Mon, 12 Mar 2007 21:11:56 +0100 (CET) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.238]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2CKBrjA014301 for ; Mon, 12 Mar 2007 21:11:55 +0100 Received: by wr-out-0506.google.com with SMTP id 50so767799wra for ; Mon, 12 Mar 2007 13:11:53 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ce9fpnQrDYUCISZ3YzBPJ2KMFYo0HTBX9qydhhPOFf0esCKvJAfRyYHRq3mCtPSRHoIGrTVPuttTO0TeNSg6ZLCVkVYD/BX6uX6aqDmf2WvBDftezxMqzNlLHvPj/laKDzQXTpH/yqmIzn+Fsy+WE03eZlRU79bc7ERsNMcMSoc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=uQWZlSOINe0dRqAw1W3I1A2EzYx0gHQ29gDsv0w6tLWq4bjB4n8tFUZjD4eYI5xpWJMmRTSdO0DatoE/NSPVLEnBn7Do03EtKQuSzTiYE3OAePDhj8vSoTBC7xz+LfDgnJDV0ov04nDsKNeSSNn0MmKsxNHYvrHFi1updcIQKC0= Received: by 10.65.242.10 with SMTP id u10mr177604qbr.1173730312142; Mon, 12 Mar 2007 13:11:52 -0700 (PDT) Received: by 10.65.100.8 with HTTP; Mon, 12 Mar 2007 13:11:52 -0700 (PDT) Message-ID: <9d3ec8300703121311h32b09b1by2955d658238d8a02@mail.gmail.com> Date: Mon, 12 Mar 2007 21:11:52 +0100 From: "Till Varoquaux" To: "ocaml ml" Subject: coercions issues MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-j-chkmail-Score: MSGID : 45F5B40A.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45F5B40A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; coercions:01 ocaml:01 coerced:01 expr:01 expr:01 binop:01 binop:01 unop:01 unop:01 cheers:01 steady:98 epos:98 epos:98 polymorphic:01 coercion:01 I still can't wrap my head around the whole polymorphic variant of Ocaml (although I am making steady progresses). Anyways here is my latest sore point: This expression cannot be coerced to type O.o Ast.T.expr O.m = O.o Ast.T.expr Mon.m; it has type O.o Ast_js.T.expr Mon.m but is here used with type O.o Ast.T.expr O.m = O.o Ast.T.expr Mon.m Type O.o Ast_js.T.expr = [ `Binop of To.binop * To.expr * To.expr | `Cst of To.constant | `Ecall of To.ident * To.arg list | `Fun of To.ident list * To.bloc | `Lval of To.lvalue | `Unop of To.unop * To.expr ] is not compatible with type O.o Ast.T.expr = [ `Binop of To.binop * To.expr * To.expr | `Cst of To.constant | `Ecall of To.ident * To.arg list | `Epos of Ast.location * To.expr | `Fun of To.ident list * To.bloc | `Lval of To.lvalue | `Unop of To.unop * To.expr ] The first variant type does not allow tag(s) `Epos I am a little confused as to why this coercion is impossible... It looks like a simple upward cast to me. Cheers, Till