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.2 required=5.0 tests=AWL,NO_REAL_NAME, RCVD_IN_BL_SPAMCOP_NET autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 104D0BBAF for ; Tue, 25 Aug 2009 20:09:45 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AikCANfFk0rUGyoFkWdsb2JhbACbDgEBAQEJCwoHEwO9YYQaBQ X-IronPort-AV: E=Sophos;i="4.44,273,1249250400"; d="scan'208";a="45444671" Received: from smtp5-g21.free.fr ([212.27.42.5]) by mail4-smtp-sop.national.inria.fr with ESMTP; 25 Aug 2009 20:09:44 +0200 Received: from smtp5-g21.free.fr (localhost [127.0.0.1]) by smtp5-g21.free.fr (Postfix) with ESMTP id 35237D480B9 for ; Tue, 25 Aug 2009 20:09:39 +0200 (CEST) Received: from apc.happyleptic.org (happyleptic.org [82.67.194.89]) by smtp5-g21.free.fr (Postfix) with ESMTP id 535E7D481B8 for ; Tue, 25 Aug 2009 20:09:37 +0200 (CEST) Received: from yeeloong (unknown [82.229.213.209]) by apc.happyleptic.org (Postfix) with ESMTP id D081D334EF for ; Tue, 25 Aug 2009 20:09:36 +0200 (CEST) Received: from rixed by yeeloong with local (Exim 4.69) (envelope-from ) id 1Mg0Sd-0000SG-6p for caml-list@inria.fr; Tue, 25 Aug 2009 20:09:35 +0200 Date: Tue, 25 Aug 2009 20:09:34 +0200 From: rixed@happyleptic.org To: 'OCaml' Subject: Re: [Caml-list] lazy vs fun Message-ID: <20090825180934.GB1702@happyleptic.org> References: <94AD5806-B6F6-44F7-AA3C-1E63B6C1A722@metaweb.com> <4A930EF0.3050900@glondu.net> <4A9311E4.7060600@ens-lyon.org> <4A931E3B.4010501@ens-lyon.org> <20090825051958.GA2066@happyleptic.org> <000301ca254d$6d4aab40$47e001c0$@metastack.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000301ca254d$6d4aab40$47e001c0$@metastack.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam: no; 0.00; interresting:01 impl:01 caml-list:01 func:01 closure:01 lazy:02 btw:03 scope:04 somewhat:05 fun:08 i'm:09 memory:09 optimisation:10 version:13 though:13 I had to read it three times, but I now understand the issue. I initialy though the first version was somewhat bugged :-) Now I understand why the second one is better. This kind of optimisation is very interresting (not capturing all the scope when building a closure). I will look for it now. And BTW, if I find the proper name for this technique in the book that I'm currently reading (The Impl. of Func. Prog. Lang.) then I will post it here to refresh your memory :)