From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA24326; Tue, 1 Jun 2004 15:00:05 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA23804 for ; Tue, 1 Jun 2004 15:00:03 +0200 (MET DST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i51CxxSH019604 for ; Tue, 1 Jun 2004 15:00:01 +0200 Received: from [192.168.1.200] (ppp114-11.lns1.syd3.internode.on.net [150.101.114.11]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i51Cxsk2048842; Tue, 1 Jun 2004 22:29:55 +0930 (CST) Subject: Re: [Caml-list] Lazy recomputing From: skaller Reply-To: skaller@users.sourceforge.net To: Thomas Fischbacher Cc: Hans Ole Rafaelsen , caml-list In-Reply-To: References: <200406011207.33006.hans@simula.no> Content-Type: text/plain Message-Id: <1086094794.16811.72.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 01 Jun 2004 22:59:54 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 40BC7DCF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 sourceforge:01 2004:99 9660:01 glebe:01 nsw:01 snail:02 lazy:02 lazy:02 checkout:02 laziness:02 2037:03 wrote:03 dependent:03 partial:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 2004-06-01 at 21:43, Thomas Fischbacher wrote: > > Is there some trick to get it recomputed, other that keep a list of all > > dependent values, and "refresh" the table whenever some value is updated? > > This is not what the general concept of laziness is about. > > You need something different. What he actually needs is a generalisation: a partial evaluator. In the actual example there is a way to make it work if you know when you change key X which keys D1, D2, .. depend on it: you just replace D1, D2 values with fresh Lazy expressions that aren't yet forced, next time they're accessed force will cause a recomputation. I do not know if this is possible in the situation, nor if the result will be efficient (but it should work :) I guess Lazy.refresh function might fix this by killing off the memoised value without having to actually replace it (and also work in a functional context). -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners