From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p2FHHBp4008689 for ; Tue, 15 Mar 2011 18:17:11 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlgEADY7f01iiloigWdsb2JhbACEPZQbjUQBAQsJEhYlsUI8gh6FfYkKAQQEAYEig0V2BIUwinyIdA X-IronPort-AV: E=Sophos;i="4.63,188,1299452400"; d="scan'208";a="93885659" Received: from nm24-vm0.bullet.mail.ne1.yahoo.com ([98.138.90.34]) by mail2-smtp-roc.national.inria.fr with SMTP; 15 Mar 2011 18:17:05 +0100 Received: from [98.138.90.50] by nm24.bullet.mail.ne1.yahoo.com with NNFMP; 15 Mar 2011 17:17:04 -0000 Received: from [98.138.89.162] by tm3.bullet.mail.ne1.yahoo.com with NNFMP; 15 Mar 2011 17:17:04 -0000 Received: from [127.0.0.1] by omp1018.mail.ne1.yahoo.com with NNFMP; 15 Mar 2011 17:17:04 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 19122.16411.bm@omp1018.mail.ne1.yahoo.com Received: (qmail 37231 invoked by uid 60001); 15 Mar 2011 17:17:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1300209423; bh=xziL+mtchJaRcYLWvREH5UR1nzAhp5q//sVf+a9hRdc=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=NUMnqnQ21Wl3A/8MSEF8ZrVF888AlUapii2FHQSQc8661nx0k6iHM8u/ueiTr929a9Wc9sxbmj86xDBl0htnKNYftiit684s3WT1qvZO6+O1LgJYSakNytTLgoSmawuhWKcv9RI6sRYJ8TiWVbw/KlzgYbgujGsg/BwLkaHs0Xs= 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=6X3w2oPi7IfNKOJgtcF5KUk239tfpn3a25XrPbetb0bIrAs8qwK6rlqOdGroJQl2MC4va6ePCR+jpKBXK9dihEfly+TMQ5zb40H+BSdaZkubuTmM6HOFcv0gq17BrP/rYcato5bnYAlx+QzOVh7Rv3koCXx0dk8LlpVp3dq9Z10=; Message-ID: <344974.14932.qm@web111506.mail.gq1.yahoo.com> X-YMail-OSG: tZudI7QVM1lLdWpcV0QleYiy.bWCs3gtzbXg0_HaEDPLuWv tUfqCRjbcXCOGQWt7RBul9_ELwDdyznooWQ9utDJevheQoYb2IbDC_HkFP.n FhAe0vGDTPbzPj0W3jJ165wmhbcX1vX1sSRkb6VuS5SZrnhZepvStk7saPk0 eeTTsDVViwLnCoUW7_oGeKrv4apHVhUMVChH.c9Cj81wQjO3nhICJxVYf06k 41QQtFSf_0coN_cb_0oRQcwyVkQpvPenyQdOda2AxiCrOpR0Djg6CI2tD8Jr sU1PHAUVxs4TzCi.0SEx345RsfGwPRVwty2cy9Brs.Fx2nJBsV8BkGMJZj5b JeP1woompQ66Rt8CJd3KQ_dT0tDZWE5coC_uPugHqvim_OJkArZm5f94NSaX jqn1UTOU39VTjPA-- Received: from [213.205.70.208] by web111506.mail.gq1.yahoo.com via HTTP; Tue, 15 Mar 2011 10:17:03 PDT X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.109.295617 Date: Tue, 15 Mar 2011 10:17:03 -0700 (PDT) From: Dario Teixeira To: caml-list@yquem.inria.fr, Nicolas Ojeda Bar In-Reply-To: <057400AC-9E39-45CC-AB7A-35C67C339F83@math.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p2FHHBp4008689 Subject: Re: [Caml-list] obj magic performance and other questions Hi, > I need to simulate, in Ocaml, the extensible records of > Oberon. I am doing the > following: > > Oberon type declaration: > > TYPE > > rec1 = RECORD a : INTEGER END; > rec2 = RECORD (rec1) b : CHAR END; > rec3 = RECORD (rec1) c : REAL END; Have you considered leveraging the structural subtyping features of the object system, or do you reckon the (small) performance penalty is too great? type rec1 = < a: int > type rec2 = < a: int; b: char > type rec3 = < a: int; c: float > let make_rec1 a = object method a = a end let make_rec2 a b = object method a = a method b = b end ...and so forth. Best regards, Dario Teixeira