Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2004-06-01 (13:00)
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,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: