caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Bless me Father, for I have used Obj.magic
Date: Fri, 23 Dec 2011 13:26:08 +0100	[thread overview]
Message-ID: <4EF47360.2010302@inria.fr> (raw)
In-Reply-To: <20111223120413.GA4433@ccellier.rd.securactive.lan>

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]

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


[-- Attachment #2: fabrice_le_fessant.vcf --]
[-- Type: text/x-vcard, Size: 380 bytes --]

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


  reply	other threads:[~2011-12-23 12:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-22 21:24 rixed
2011-12-22 22:07 ` Fabrice Le Fessant
2011-12-22 22:19   ` rixed
2011-12-22 23:29 ` Thierry Martinez
2011-12-23 12:04   ` rixed
2011-12-23 12:26     ` Fabrice Le Fessant [this message]
2011-12-30 11:41       ` Damien Doligez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EF47360.2010302@inria.fr \
    --to=fabrice.le_fessant@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).