2017-01-25 15:52 GMT+01:00 Clément Bera <bera.clem...@gmail.com>: > Overall, you need to: > - change the code of all numbered primitives mutating objects (such as > at:put:) so that when they fail because of a read-only object they call the > modification tracker framework. >
I think it is for future. But now behaviour is just inconsistent because making object readonly breaks any app using it *silently*. Also I see that instVarAt:put: will raise error instead of skipping it. So two ways to modify object lead to different behavior. It's not good. My conclusion: it must be error by default. Something like this: Object>>#attemptToAssign: value withIndex: index (ModificationForbidden for: self at: index with: value) signal It is not fix completely inconsistence with #instVarAt:put: but at least they both will fail. By the way I was supprized that failed #instVarAt:put: shows "bad receiver" in primitive *er* variable (<primitive: 174 error: *ec*>). Is "bad receiver" is always about mutability? And if not then how we will distinguish different cases?