El 5 de mayo de 2010 08:00, Christian Jaeger <chrjae@gmail.com> escribió:
> Are the results of forced delayed computations memoized in Gambit?Gambit follows R5RS. See the description of force at
http://people.csail.mit.edu/jaffer/r5rs_8.html#SEC64
It is the recommended method to write code using call by need, no more, no less.
> If so, is this a recommended method for memoization?
Call by need means, the evaluation of an expression from a particular
runtime context is only being done if the result of the expression is
needed, and thanks to the implicit memoization, it is only being done
once even if the result (of that same expression from the same
context) is needed several times.
It does not however mean that the same promise (and hence memoized
result) will be reused if you happen to want the result of the same
expression but in a new runtime context, even if the context consists
of the same values as earlier.
Ch.