> The array solution first computes the complete array ?
> 
> My function is so expensive, and I do not know a priori
> which arguments are needed at all, so precomputation of the complete
> cache isn't tracktable.

What is required a priori is to determine the range over which the
function is to be memoised and the allocation of the appropriately sized array.
You can modify the memoise function to just call the unmemoised function 
normally if the args are outside this array.

Patrick.


Reply via email to