English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
lazy vs fun
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-08-24 (23:33)
From: Warren Harris <warren@m...>
Subject: Re: [Caml-list] lazy vs fun

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,