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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 20D87BC57 for ; Sun, 28 Mar 2010 22:17:34 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgQDABtWr0tDww+vi2dsb2JhbACPEy+BTnyJMgEBAQoLCgcPBR+tKYFphD+IegEEBAGEfASDHg X-IronPort-AV: E=Sophos;i="4.51,323,1267398000"; d="scan'208";a="47618501" Received: from web111508.mail.gq1.yahoo.com ([67.195.15.175]) by mail3-smtp-sop.national.inria.fr with SMTP; 28 Mar 2010 22:17:33 +0200 Received: (qmail 62962 invoked by uid 60001); 28 Mar 2010 20:17:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1269807451; bh=oTRUgriVU/vV1OOpcKI9CvmHxqMfGC6t1F71FW2FLpU=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ou9kYYfImQOcWY87CRtCIAIAdg2DsuYseAHBs35+Kt+SEjTlGpzmITA0IJfnKR1MEQdkLatY4P+MLtlIRy4ZvDaZtTX/MJo4FEGpOhwA486hW7zRJxW1CmH09xSpc+TeP9o5kW7BIO9DlgU8ZVvTc0RDM3OSiolSDRy9ljgKjjY= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=hPxs3C0rC1GIiPRJ0UTdGD9JTZfgwZk/MDpFtmbRYc2Mg474jfnJvriGdOWuDr3e67FES4ZgqZ7hPVrgLwqx9KPNTaSMG/lSL9XdeQnkoAtuC1n4uRRP81K+6lboV/p4HbGluJ8KKKIME9yX76UVgAfWo8m4jfyT4yXA2jgoXww=; Message-ID: <43273.62743.qm@web111508.mail.gq1.yahoo.com> X-YMail-OSG: tGMvdfAVM1mPxzY1DDB8Nci3KXefIzhJC11KZD.BvRaRCX3 paNz1hyvo4TxB4SwiPjlLsChr1talC0aQC14H4CtBoAQ88xOyxZdM7wZelfD sVErmuBdfAotzgoi2L8hI16BOZxAMhbBxi0Nxk.HcRD5_.1RoUAKHCYmiB4v Uq7jpMMKYWUyZ3IRanZBFaSteFatEgZDWRtkAEmMmkCFjJATh0xP4KmjFvy7 D4GxTyQmWZHXZ8qJyTEFgdWGkUGsPcvEZ13YfL3dvKm.RMo6rIVhTifAcuKP 5FjJnCA9NLDv8xZDjkE9ADxDhhMCVJDwTysBXJXP_5ARlv0exXQIfn6E- Received: from [213.205.71.61] by web111508.mail.gq1.yahoo.com via HTTP; Sun, 28 Mar 2010 13:17:30 PDT X-Mailer: YahooMailClassic/10.0.8 YahooMailWebService/0.8.100.260964 Date: Sun, 28 Mar 2010 13:17:30 -0700 (PDT) From: Dario Teixeira Subject: Re: [Caml-list] Structural subtyping problem To: caml-list@yquem.inria.fr In-Reply-To: <61102.44294.qm@web111503.mail.gq1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; subtyping:01 subtyping:01 ocaml's:01 intuitively:01 compiler:01 annotations:01 coercions:01 real-world:01 cheers:01 caml-list:01 coercion:01 emulate:01 width:97 seems:03 shape:96 Hi,=0A=0A> I'm using the structural subtyping aspects of Ocaml's object sys= tem to emulate width=0A> subtyping.=A0 I've come across a problem which doe= s not type-check, though intuitively=0A> it seems correct.=A0 I reckon that= the compiler may need some help in the form of type=0A> annotations and/or= coercions, though their exact shape elludes me.=0A=0AThank you all for you= r assistance. In the real-world code, the solution=0Abased on coercion is = the most straightforward to implement. And it looks=0Aobvious now...=0A=0A= Cheers,=0ADario Teixeira=0A=0A=0A=0A