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 76D0EBC5B for ; Mon, 1 Mar 2010 14:28:38 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar0DACZQi0vZSMDqimdsb2JhbACbDhUBAQEKCQwHEQUfuSuCT4IsBA X-IronPort-AV: E=Sophos;i="4.49,560,1262559600"; d="scan'208";a="45751039" Received: from fmmailgate03.web.de ([217.72.192.234]) by mail3-smtp-sop.national.inria.fr with ESMTP; 01 Mar 2010 14:28:38 +0100 Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate03.web.de (Postfix) with ESMTP id 8940714113BB0 for ; Mon, 1 Mar 2010 14:28:37 +0100 (CET) Received: from [85.216.85.71] (helo=frosties.localdomain) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #314) id 1Nm5fp-0008U8-00 for caml-list@inria.fr; Mon, 01 Mar 2010 14:28:37 +0100 Received: from mrvn by frosties.localdomain with local (Exim 4.71) (envelope-from ) id 1Nm5fo-0000gb-Ti for caml-list@inria.fr; Mon, 01 Mar 2010 14:28:37 +0100 From: Goswin von Brederlow To: 'OCaml List' Subject: Re: [Caml-list] Recursive subtyping issue In-Reply-To: <000d01cab93d$b095c770$11c15650$@romulus.metastack.com> (David Allsopp's message of "Mon, 1 Mar 2010 12:49:53 -0000") References: <4B887AED.3090005@citycable.ch> <4B88F32C.3050701@citycable.ch> <87k4tyoq3m.fsf@frosties.localdomain> <4B891A0C.604@citycable.ch> <76EDF2F2-8B02-4C97-B083-EC74630D8ECA@mpi-sws.org> <4B896026.2070805@citycable.ch> <4B89780E.5080305@citycable.ch> <4B898179.1000600@citycable.ch> <4B8B9D15.7070300@glondu.net> <4B8BA350.8090404@citycable.ch> <000d01cab93d$b095c770$11c15650$@romulus.metastack.com> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) Date: Mon, 01 Mar 2010 14:28:36 +0100 Message-ID: <87ocj8jhmj.fsf@frosties.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX1947NeH7UlQ3q3ek3Q6Ni5pvSydlrnzM9KZNdxK FLnuamweiKil+hAjOcoaKhGQmb/gg+u6TNyMWmtdt05390Hcwh CW67g7XCs= X-Spam: no; 0.00; recursive:01 subtyping:01 foo:01 foo:01 mli:01 ocamlopt:01 inlining:01 eliminates:98 mfg:98 caml-list:01 writes:01 primitive:02 external:03 module:03 let:03 "David Allsopp" writes: > external foo_of_bar : bar -> foo = "%identity" > > in *both* the .ml and .mli file for the module in question. I'm virtually certain that ocamlopt eliminates calls to the %identity primitive. Where is that documented? I would have written let foo_of_bar (x : bar) = (x :> foo) and hoped the inlining would eliminate it. MfG Goswin