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.7 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST autolearn=disabled version=3.1.3 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 026E8BBAF for ; Mon, 1 Jun 2009 15:56:09 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlIEAAt7I0pDww/BmGdsb2JhbACQTYEmhh0BAQEBAQgJDAcRpAaBFI4cAQUDAYQIBQ X-IronPort-AV: E=Sophos;i="4.41,284,1241388000"; d="scan'208";a="27134013" Received: from web111511.mail.gq1.yahoo.com ([67.195.15.193]) by mail2-smtp-roc.national.inria.fr with SMTP; 01 Jun 2009 15:56:08 +0200 Received: (qmail 743 invoked by uid 60001); 1 Jun 2009 13:56:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1243864566; bh=0xgPp7BPuPHU2bf3XbaSyXsP834oX5fVmtr/nOXLZRA=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=lDjtIUDqeS/KGvG+1s9xJCU8uygGsXynmnltokLmYtHpCgIJTzRFEtKfUoZmYq03NfGUeWU9cvvYOOBJs2oUn+byyHERDoDyTsurIDFHOUr6JDo2UuRmcqFrL70xgpUwpaAf/weSis7GqqtYPToOArwReOhstgXaP9vMI3BMO2o= 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:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=O6odSKqhepnee/H9+IlrTac9RfVxYlvRGB6J+VnU2fz0ys7xDFTERpIDaJf43rDJwhhvx9a7XMq+Xd/E9q7RuVc0W80NBK0TCnSeTA6Pzpz2FvFXjulWIR1ruEBFyA4RXCz+jBp53AvcfDXN/IIbLAE7GN2z2CjVowSHSsTWnxM=; Message-ID: <820784.66094.qm@web111511.mail.gq1.yahoo.com> X-YMail-OSG: u2x4JZkVM1lA6tLqOt6J1gY34IIUJF6nRmzWMZCTy2ADXJlb6EEU0jtreDPkvpH2Bf75NoUdPixJDXfxuxWKg58OaP.xA12F1gVK.RM93J.N7Gw9mrW2WJXj_LCC2HDDrxJ_SOBQm3AVTNctSITCxtN.mcE9aCuLDEcVb4daPGZj8QV28P9ncc_XQbFQ3cwAbA.eNF4v_Jwt4y3KWFH0feusDgxWpB7TcRqx0lZCp7MHTxAuiZPgS7kT9NOZ1rIBlpFH8MsyseMjpA_FIRCVHDQoSHnH.5qVUwVNgPoC1asuYasWF6BmoUFQFiuZ7S_iNJ6GHqA- Received: from [213.205.70.194] by web111511.mail.gq1.yahoo.com via HTTP; Mon, 01 Jun 2009 06:56:06 PDT X-Mailer: YahooMailClassic/5.3.9 YahooMailWebService/0.7.289.10 Date: Mon, 1 Jun 2009 06:56:06 -0700 (PDT) From: Dario Teixeira Subject: Re: [Caml-list] Width subtyping To: yminsky@gmail.com Cc: caml-list@yquem.inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; subtyping:01 subtypes:01 cheers:01 abstract:01 syntactic:01 caml-list:01 width:97 overhead:04 problem:05 cases:08 i'm:09 object:09 object:09 memory:09 guessing:09 Hi,=0A=0A> If you're willing to give up some of the syntactic=0A> niceties = of records (and the ability to pattern-match) you=0A> can get what you want= using an abstract type.=0A=0AThanks -- that is also an interesting solutio= n. I'm guessing it will=0Abe faster, though it might consume more memory i= n cases where only one=0Afield is actually used. I'll have to try it side-= by-side with the object=0Abased solution to see how they compare in the rea= l world with my actual=0Aproblem...=0A=0A=0A> Here, we've chosen to use a d= efault value for fields=0A> that we don't fill in.=A0 We could just as well= have used=0A> options here.=A0 The performance of the above will be roughl= y=0A> the same as the performance of a simple record.=A0 Obviously,=0A> all= of the different "subtypes" have the full=0A> record stored at a physical = level.=0A=0AWhich might turn out to be not that big a deal. After all, the= object=0Abased solution also adds some default overhead per object created= , right?=0A=0ACheers,=0ADario Teixeira=0A=0A=0A=0A