From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 32949BB81 for ; Tue, 7 Dec 2004 22:42:41 +0100 (CET) Received: from vapor.isi.edu (vapor.isi.edu [128.9.64.64]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iB7Lgd1H032274 for ; Tue, 7 Dec 2004 22:42:40 +0100 Received: from albini.isi.edu (albini.isi.edu [128.9.216.111]) by vapor.isi.edu (8.11.6p2+0917/8.11.2) with ESMTP id iB7Lfjq10478 for ; Tue, 7 Dec 2004 13:41:45 -0800 (PST) Date: Tue, 7 Dec 2004 13:41:45 -0800 (PST) From: Hal Daume III To: Caml Mailing List Subject: lazy application to Lazy.t Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-ISI-4-32-5-MailScanner: Found to be clean X-MailScanner-From: hdaume@isi.edu X-Miltered: at concorde with ID 41B623CF.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lazy:01 lazy:01 val:01 int:01 maths:02 talks:02 let:03 let:03 suppose:05 incr:06 edu:07 edu:07 fun:08 fun:08 isi:09 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: suppose I have val x : int ref Lazy.t and I want to 'incr' it, but want to keep it lazy. i.e., if i start with: let x = Lazy.lazy_from_fun (fun () -> ref 0) then i run my lazy_incr on it, I want: let y = Lazy.force x to return 1 but i only want 'incr' to be run when I Lazy.force x. is there a way to accomplish this? -- Hal Daume III | hdaume@isi.edu "Arrest this man, he talks in maths." | www.isi.edu/~hdaume