It’s to do with memory management. An Array is allocated with a fixed max size, which you can specify. If your add exceeds that max size add returns a new Array. If not it does return/alter the receiver. So the usual advice is to reassign if you’re not sure if this will happen, i.e. a = a.add(2); Help for this: Set max size appropriately if you know it in advance, or use a List, which has an Array, and handles the reallocation automatically if needed. I can’t comment on how worthwhile this design is these days. Possibly it was more appropriate in the early days of SC. In general though it pays to think about max size anyway though, as object allocation is one of the more expensive things to do CPU wise. Some years back I did a survey of all calls to Array:add or ++ in Common and set appropriate max sizes, and used add instead of ++ where possible. The savings were impressive in some cases. S. |