From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pBMNTgg6011166 for ; Fri, 23 Dec 2011 00:29:42 +0100 X-IronPort-AV: E=Sophos;i="4.71,396,1320620400"; d="scan'208";a="124380581" Received: from bon42-1-88-166-100-8.fbx.proxad.net (HELO BRUME.inria.fr) ([88.166.100.8]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 23 Dec 2011 00:29:36 +0100 From: Thierry Martinez To: rixed@happyleptic.org Cc: caml-list@inria.fr In-Reply-To: <20111222212429.GA8156@yeeloong.happyleptic.org> (rixed@happyleptic.org's message of "Thu, 22 Dec 2011 22:24:30 +0100") Organization: INRIA Paris-Rocquencourt References: <20111222212429.GA8156@yeeloong.happyleptic.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (windows-nt) X-Prof-Page: http://bat8.inria.fr/~tmartine/ X-Prof-Land-Phone: +33 1 39 63 58 33 X-Prof-Address: INRIA Paris-Rocquencourt Research Centre - Room 809, Domaine de Voluceau, Rocquencourt - BP 105, 78153 Le Chesnay Cedex - France X-Mobile-Phone: +33 6 07 82 61 15 X-Home-Phone: +33 9 54 43 26 72 X-Home-Page: http://www.normalesup.org/~martinez/ X-Home-Address: 9 rue de la Roseraie, 92360 Meudon La Fore^t Date: Fri, 23 Dec 2011 00:29:32 +0100 Message-ID: <874nws89sz.fsf@inria.fr> 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 pBMNTgg6011166 Subject: Re: [Caml-list] Bless me Father, for I have used Obj.magic rixed@happyleptic.org : > let make ... = > let some_operation t_priv t1 = > ... use t_priv to return a t2 ... in > let rec t_priv = { t ; > some_other_fields = some_values } > and t = { operation = some_operation t_priv ; > some_fields = some_values } > in t > > This does not compile because of the way t_priv is used within t > construction. The policed way to get around this seams to be: This will compile if you η-expand the partial application of some_operation into “(fun t1 -> some_operation t_priv t1)”. But perhaps your example is over simplified and hide the real difficulty. -- Thierry.