[gambit-list] memoization of delayed computations

Álvaro Castro-Castilla alvaro.castro.castilla at gmail.com
Wed May 5 06:00:36 EDT 2010


El 5 de mayo de 2010 08:00, Christian Jaeger <chrjae at 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
>
> > If so, is this a recommended method for memoization?
>
> It is the recommended method to write code using call by need, no more, no
> less.
>
> 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.
>



Oh, it's pretty clear in R5RS. I read about this stuff somewhere else where
it said that it depended on the implementation.

Thanks,

Álvaro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20100505/c289c0a4/attachment.htm>


More information about the Gambit-list mailing list