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.6 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 50E28BBAF for ; Tue, 25 Aug 2009 01:33:23 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AocDAIPAkkrQRG8ZgWdsb2JhbACbCAEBFiS7MYQaBQ X-IronPort-AV: E=Sophos;i="4.44,268,1249250400"; d="scan'208";a="31595457" Received: from mx01.metaweb.com ([208.68.111.25]) by mail2-smtp-roc.national.inria.fr with SMTP; 25 Aug 2009 01:33:22 +0200 Received: from zimbra01.corp.sjc1.metaweb.com (localhost [127.0.0.1]) by mx01.metaweb.com (Spam Firewall) with ESMTP id 061BDEEA1E; Mon, 24 Aug 2009 16:33:20 -0700 (PDT) Received: from zimbra01.corp.sjc1.metaweb.com ([172.29.253.13]) by mx01.metaweb.com with ESMTP id SZCOhnZe1s2zyLqO; Mon, 24 Aug 2009 16:33:20 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra01.corp.sjc1.metaweb.com (Postfix) with ESMTP id E9C87160D882; Mon, 24 Aug 2009 16:33:20 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra01.corp.sjc1.metaweb.com Received: from zimbra01.corp.sjc1.metaweb.com ([127.0.0.1]) by localhost (zimbra01.corp.sjc1.metaweb.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wRUQ9Nwz1ucO; Mon, 24 Aug 2009 16:33:13 -0700 (PDT) Received: from timesink.corp.631h.metaweb.com (timesink.corp.631h.metaweb.com [172.31.20.32]) by zimbra01.corp.sjc1.metaweb.com (Postfix) with ESMTP id 78624160C7D0; Mon, 24 Aug 2009 16:33:13 -0700 (PDT) Cc: =?ISO-8859-1?Q?St=E9phane_Glondu?= , OCaml Message-Id: <328F8198-C9E5-4F19-8D44-F175D804E4DD@metaweb.com> From: Warren Harris To: Martin Jambon In-Reply-To: <4A931E3B.4010501@ens-lyon.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Caml-list] lazy vs fun Date: Mon, 24 Aug 2009 16:33:13 -0700 References: <94AD5806-B6F6-44F7-AA3C-1E63B6C1A722@metaweb.com> <4A930EF0.3050900@glondu.net> <4A9311E4.7060600@ens-lyon.org> <4A931E3B.4010501@ens-lyon.org> X-Mailer: Apple Mail (2.936) X-Spam: no; 0.00; warren:98 warren:98 wrote:01 caml-list:01 oops:01 jambon:01 closure:01 lazy:02 lazy:02 correctly:04 fun:08 practice:09 whereas:10 aug:10 martin:13 On Aug 24, 2009, at 4:11 PM, Martin Jambon wrote: > > Oops. > The following makes it possible for f to be garbage-collected: > [...] If I understand correctly, the closure associated with f will be collectable after the lazy_t is forced, whereas before its lifetime would be bound to the lifetime of the lazy_t. That's very subtle. It would have taken me some time to track that one down if it had come up in practice. Thanks, Warren