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,HTML_MESSAGE,SPF_SOFTFAIL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 5CEE3BCA9 for ; Wed, 22 Aug 2007 20:33:53 +0200 (CEST) Received: from mail-red.research.att.com (mail-red.research.att.com [192.20.225.110]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7MIXqMb014841 for ; Wed, 22 Aug 2007 20:33:53 +0200 Received: from [192.168.0.100] (vpn-14.research.att.com [135.207.240.14]) by bigmail.research.att.com (8.13.7+Sun/8.11.6) with ESMTP id l7MIXqXp006024 for ; Wed, 22 Aug 2007 14:33:52 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v752.3) To: caml-list@yquem.inria.fr Message-Id: <72195753-8535-4D6F-BD60-79ED3C21B5D9@research.att.com> Content-Type: multipart/alternative; boundary=Apple-Mail-147--952978392 From: Yitzhak Mandelbaum Subject: safe casting Date: Wed, 22 Aug 2007 14:33:39 -0400 X-Mailer: Apple Mail (2.752.3) X-j-chkmail-Score: MSGID : 46CC8190.004 on concorde : j-chkmail score : XX : 0/20 2 0.000 -> 2 X-Miltered: at concorde with ID 46CC8190.004 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; yitzhak:01 mandelbaum:01 yitzhak:01 parametric:01 struct:01 struct:01 sig:01 runtime:01 mandelbaum:01 parametric:01 sig:01 runtime:01 functions:01 functions:01 int:01 --Apple-Mail-147--952978392 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hi, Given two record types that are identical but in name, is it safe (if perhaps a poor idea) to cast between functions that are parametric in these record types: e.g. Given, module A = struct type t = {a:int} end module B = struct type t = {a:int} end Is this safe ? module F(Ty: sig type t = {a:int} end) = struct let extract {Ty.a=x} = x end module F_A = F(A) let y = {B.a=3} (Obj.magic F_A.extract) y Put another way: is the implementation of two records w/ identical labels the same, or is there a runtime significance to their static difference? Thanks, Yitzhak -------------------------------------------------- Yitzhak Mandelbaum AT&T Labs - Research http://www.research.att.com/~yitzhak --Apple-Mail-147--952978392 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1
Hi,

Given two = record types that are identical but in name, is it safe (if perhaps a = poor idea) to cast between=A0functions that are parametric in these = record types:

e.g. Given,=A0

module A =3D=A0
=A0 type t =3D {a:int}
end

module B =3D=A0
=A0 type t =3D {a:int}
end

Is this safe = ?=A0

module F(Ty: = sig type t =3D {a:int}=A0end) =3D
=A0 let extract {Ty.a=3Dx} =3D = x
end

module F_A =3D F(A)
let y =3D = {B.a=3D3}
(Obj.magic F_A.extract) = y

Put another = way:=A0 is the implementation of two records w/ identical labels the = same, or is there a runtime significance to their static = difference?

Thanks,

= --Apple-Mail-147--952978392--