Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Lazy recomputing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Lazy recomputing
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