From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr 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 pBNCQXZM007595 for ; Fri, 23 Dec 2011 13:26:33 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoABAEpz9E5KfVK2i2dsb2JhbABDhQ+nIAgiAQEBCgsLBxIGIYFyAQEBBBICDwQZATcCAwwBBQUYCRYLAgIJAwIBAgEiAQUBHBMGAgEBHodamjEKix2DM4RiiTACBQuIaoIEgRYEjiaBF4VFhU+BNYZ5PYFNgi4 X-IronPort-AV: E=Sophos;i="4.71,398,1320620400"; d="vcf'?scan'208";a="124455763" Received: from mail-we0-f182.google.com ([74.125.82.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 23 Dec 2011 13:26:13 +0100 Received: by werb13 with SMTP id b13so7360220wer.27 for ; Fri, 23 Dec 2011 04:26:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; bh=1uO7Virve2hqWAvW0xVRq9XehVfCQheDxBO7pPMeHC8=; b=HTX3NVvBATG4eOxeH7Qw6+93+ElzlF6WDFp3PkgpBpD0pcf6F0fOMYygKXF/J0Mm1M e5vVHQB2Oj/zPFXgLQi/vV7fHzUTRbBA529lSiqKBJW0OMFDlj6vDty//ZbZpNrqh/h2 VTIN4rpMcvW0fbpQl8MpD6XbeD/sC3eT56cBE= Received: by 10.216.138.148 with SMTP id a20mr13594868wej.15.1324643172771; Fri, 23 Dec 2011 04:26:12 -0800 (PST) Received: from [193.55.250.228] (chercheurs2-228.saclay.inria.fr. [193.55.250.228]) by mx.google.com with ESMTPS id fy5sm31194547wib.7.2011.12.23.04.26.08 (version=SSLv3 cipher=OTHER); Fri, 23 Dec 2011 04:26:09 -0800 (PST) Sender: Fabrice Le Fessant Message-ID: <4EF47360.2010302@inria.fr> Date: Fri, 23 Dec 2011 13:26:08 +0100 From: Fabrice Le Fessant User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Lightning/1.0b2 Thunderbird/3.1.16 MIME-Version: 1.0 To: caml-list@inria.fr References: <20111222212429.GA8156@yeeloong.happyleptic.org> <874nws89sz.fsf@inria.fr> <20111223120413.GA4433@ccellier.rd.securactive.lan> In-Reply-To: <20111223120413.GA4433@ccellier.rd.securactive.lan> X-Enigmail-Version: 1.1.2 Content-Type: multipart/mixed; boundary="------------010600050002050109010503" X-Validation-by: fabrice.le_fessant@inria.fr Subject: Re: [Caml-list] Bless me Father, for I have used Obj.magic This is a multi-part message in MIME format. --------------010600050002050109010503 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 12/23/2011 01:04 PM, rixed@happyleptic.org wrote: >> 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. > > No you are right, once eta-epxanded the compiler accepted the code. > I wonder what difference it makes in the generated code, if any. > Thank you very much for the tip! The difference is that the function is evaluated everytime you want to access the value. If the function is cheap and has no side-effect, it is perfectly fine, but if it is not the case, the cost will be much higher. --Fabrice --------------010600050002050109010503 Content-Type: text/x-vcard; charset=utf-8; name="fabrice_le_fessant.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fabrice_le_fessant.vcf" begin:vcard fn:Fabrice LE FESSANT n:LE FESSANT;Fabrice org:INRIA Saclay -- Ile-de-France;P2P & OCaml adr;quoted-printable:;;Parc Orsay Universit=C3=A9 ;Orsay CEDEX;;91893;France email;internet:fabrice.le_fessant@inria.fr title;quoted-printable:Charg=C3=A9 de Recherche tel;work:+33 1 74 85 42 14 tel;fax:+33 1 74 85 42 49 url:http://fabrice.lefessant.net/ version:2.1 end:vcard --------------010600050002050109010503--