
5 Sep
2007
5 Sep
'07
6:37 p.m.
Can someone explain me, why there are arrays with mutable but boxed elements? I thought that boxing is only needed for lazy evaluation. However if I access an element of an array that is the result of a sequence of in-place updates, all updates must be executed in order to get the final value. That is, the first access to an element of such an array evaluates all elements of the array - which sounds for me like eager evaluation. So what's the reason for boxes in mutable arrays? Maybe I misunderstand the Box concept, and Box means just Pointer. It would make sense to store pointers in an array if the size of the elements vary.