Tagged

Closure memoization in Groovy

This example shows how its possible to cache (memoization) a Closure value, note that this works only for a single value per each delay method call (the Closure creates a closed scope in which its "state" is kept).