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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 68541BC57 for ; Sun, 28 Mar 2010 19:03:13 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArEBAGYor0vRVdrYkGdsb2JhbACBRoMAjEmKEQgVAQEBAQkJDAcRAx+tPIFphEEuiEwBAQMFhHwE X-IronPort-AV: E=Sophos;i="4.51,323,1267398000"; d="scan'208,217";a="47929618" Received: from mail-bw0-f216.google.com ([209.85.218.216]) by mail2-smtp-roc.national.inria.fr with ESMTP; 28 Mar 2010 19:03:13 +0200 Received: by bwz8 with SMTP id 8so4228935bwz.3 for ; Sun, 28 Mar 2010 10:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer; bh=y7nbIlcXD/TJyOka/DY2+ASrcC6sRgIRWmJlHueFn/g=; b=DPD8vT4n6hRqhEH5jqq3B1ZHR25j9c8PpDaLLNWecPglkfazJ0dpD018k6yzw65gEP mpp0XzYBtL0qmpJG+kEJ77XBZXF8lQDEVMuF0PQXGlyfvHZhmZ+vFJW01VAYO9W4N4XC etdQusNscM4YCSFy6uFl0j5ll5Tq2F8GXfK3g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=SSvcREHkrtB63u79O0i5p1jYPzF6RQND2wfw5E77XcfYur/9/Gzueqj8f0yy2Xry/S oIaFqqaRUSpRT0dPeuxdHUysUAtva/Up+FlPAjIH776vqll21oj2ts+c4dTgaeWvd2vm Gu6faXE7O9wJ5o/U6KFltB907EIzm2oQrJK6o= Received: by 10.204.4.139 with SMTP id 11mr2848357bkr.27.1269795792411; Sun, 28 Mar 2010 10:03:12 -0700 (PDT) Received: from [192.168.0.11] (tui75-1-81-57-73-233.fbx.proxad.net [81.57.73.233]) by mx.google.com with ESMTPS id x16sm29716812bku.5.2010.03.28.10.03.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 28 Mar 2010 10:03:11 -0700 (PDT) Cc: caml-list@yquem.inria.fr Message-Id: <49DFC32A-514B-4C2F-A871-4A4BDFE0E7DC@gmail.com> From: Vincent Aravantinos To: Dario Teixeira In-Reply-To: <61102.44294.qm@web111503.mail.gq1.yahoo.com> Content-Type: multipart/alternative; boundary=Apple-Mail-2--569186982 Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Caml-list] Structural subtyping problem Date: Sun, 28 Mar 2010 19:03:08 +0200 References: <61102.44294.qm@web111503.mail.gq1.yahoo.com> X-Mailer: Apple Mail (2.936) X-Spam: no; 0.00; subtyping:01 cheers:01 cheers:01 monaco:98 helvetica:98 rec:01 rec:01 caml-list:01 match:02 match:02 imag:02 imag:02 string:02 string:02 seems:03 --Apple-Mail-2--569186982 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Hi, the following seems to do the trick (?) : Le 28 mars 10 =E0 18:38, Dario Teixeira a =E9crit : > let rec step1 ?story () =3D match story with > | Some s -> step2 s#title > | None -> step2 "title1" > > > and step2 title =3D > let story =3D > object > method title =3D title > method count =3D 0 > end > in step3 ~story > > > and step3 ~story =3D match story#count with > | 0 -> >> - step1 ~story () + step1 ~story:(story :> ) () > | 1 -> > let story =3D > object > method title =3D "title2" > end > in step1 ~story () > | _ -> > true Cheers, -- Vincent Aravantinos - PhD Student - Laboratory of Informatics of =20 Grenoble http://membres-lig.imag.fr/aravantinos/ --Apple-Mail-2--569186982 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; = -webkit-line-break: after-white-space; ">Hi, the following seems to do = the trick  (?) :<div><br><div apple-content-edited=3D"true"> <span = class=3D"Apple-style-span" style=3D"border-collapse: separate; color: = rgb(0, 0, 0); font-family: Monaco; font-size: medium; font-style: = normal; font-variant: normal; font-weight: normal; letter-spacing: = normal; line-height: normal; orphans: 2; text-align: auto; text-indent: = 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: = 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = Monaco; font-size: medium; font-style: normal; font-variant: normal; = font-weight: normal; letter-spacing: normal; line-height: normal; = orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; = widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant: normal; = font-weight: normal; letter-spacing: normal; line-height: normal; = orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; = widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant: normal; = font-weight: normal; letter-spacing: normal; line-height: normal; = orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; = widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant: normal; = font-weight: normal; letter-spacing: normal; line-height: normal; = orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; = widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant: normal; = font-weight: normal; letter-spacing: normal; line-height: normal; = orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; = widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><div><span class=3D"Apple-style-span" = style=3D"font-family: Monaco; font-size: medium; ">Le 28 mars 10 =E0 = 18:38, Dario Teixeira a =E9crit = :</span></div></div></span></div></span></div></span></div></span></div></= span></div></span></div><div><br = class=3D"Apple-interchange-newline"><blockquote type=3D"cite"><div>let = rec step1 ?story () =3D match story with<br><span class=3D"Apple-tab-span"= style=3D"white-space:pre"> </span>| Some s -> step2 = s#title<br><span class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span>| None   -> step2 "title1"<br><br><br>and step2 = title =3D<br><span class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span>let story =3D<br><span class=3D"Apple-tab-span" = style=3D"white-space:pre"> </span><span class=3D"Apple-tab-span" = style=3D"white-space:pre"> </span>object<br><span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span><span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span><span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>method = title =3D title<br><span class=3D"Apple-tab-span" = style=3D"white-space:pre"> </span><span class=3D"Apple-tab-span" = style=3D"white-space:pre"> </span><span class=3D"Apple-tab-span" = style=3D"white-space:pre"> </span>method count =3D 0<br><span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span><span = class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span>end<br><span class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span>in step3 ~story<br><br><br>and step3 ~story =3D match story#count = with<br><span class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span>| 0 -><br><blockquote = type=3D"cite"></blockquote></div></blockquote><div>-<span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span><span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>step1 = ~story ()<br></div><div>+             =   step1 ~story:(story :> <title : string>) = ()</div><blockquote type=3D"cite"><div><span class=3D"Apple-tab-span" = style=3D"white-space:pre"> </span>| 1 -><br><span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span><span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>let story = =3D<br><span class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span><span class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span><span class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span>object<br><span class=3D"Apple-tab-span" style=3D"white-space:pre">= </span><span class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span><span class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span><span class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span>method title =3D "title2"<br><span class=3D"Apple-tab-span" = style=3D"white-space:pre"> </span><span class=3D"Apple-tab-span" = style=3D"white-space:pre"> </span><span class=3D"Apple-tab-span" = style=3D"white-space:pre"> </span>end<br><span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span><span = class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>in step1 = ~story ()<br><span class=3D"Apple-tab-span" style=3D"white-space:pre"> = </span>| _ -><br><span class=3D"Apple-tab-span" = style=3D"white-space:pre"> </span><span class=3D"Apple-tab-span" = style=3D"white-space:pre"> = </span>true<br></div></blockquote></div><br></div><div>Cheers,</div><div><= div><span class=3D"Apple-style-span" style=3D"border-collapse: separate; = color: rgb(0, 0, 0); font-family: Monaco; font-size: medium; font-style: = normal; font-variant: normal; font-weight: normal; letter-spacing: = normal; line-height: normal; orphans: 2; text-indent: 0px; = text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; = -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: = 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = Monaco; font-size: medium; font-style: normal; font-variant: normal; = font-weight: normal; letter-spacing: normal; line-height: normal; = orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; = widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant: normal; = font-weight: normal; letter-spacing: normal; line-height: normal; = orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; = widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant: normal; = font-weight: normal; letter-spacing: normal; line-height: normal; = orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; = widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant: normal; = font-weight: normal; letter-spacing: normal; line-height: normal; = orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; = widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><span class=3D"Apple-style-span" = style=3D"border-collapse: separate; color: rgb(0, 0, 0); font-family: = Helvetica; font-size: 12px; font-style: normal; font-variant: normal; = font-weight: normal; letter-spacing: normal; line-height: normal; = orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; = widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; = -webkit-border-vertical-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div style=3D"word-wrap: = break-word; -webkit-nbsp-mode: space; -webkit-line-break: = after-white-space; "><div>--</div><div>Vincent Aravantinos - PhD = Student - Laboratory of Informatics of Grenoble</div><div><a = href=3D"http://membres-lig.imag.fr/aravantinos/">http://membres-lig.imag.f= r/aravantinos/</a></div><div><font class=3D"Apple-style-span" = face=3D"Monaco"><span class=3D"Apple-style-span" style=3D"font-size: = medium;"><font class=3D"Apple-style-span" face=3D"Helvetica" = size=3D"3"><span class=3D"Apple-style-span" style=3D"font-size: = 12px;"><br></span></font></span></font></div></div></span></div></span></d= iv></span></div></span></div></span></div></span></div><div></div></div></= body></html>= --Apple-Mail-2--569186982--