
22 May
2007
22 May
'07
2:36 a.m.
Matthew Brecknell wrote:
This seems to work, but presumably only because it's a boxed array, and the construction makes no circular references.
Yes, AIUI the boxed arrays are strict in indices but lazy in values. Therefore they can be used for this kind of memoization trick as long as you're access the elements in 'some sensible order' (that is the calculation dependencies are well-ordered).