Nov. 21, 2009
8:36 p.m.
Simon Denier wrote:
Try the following (1) (1 to: 10) at: 2 returns 2
then (2) (1 to: 10) basicAt: 2 raises an exception
It is surprising.
Problem is that Interval redefines at: but in (2), the lookup retrieves Object>>basicAt: which only works for indexable objects (which an interval is not).
So Interval should also redefine basicAt: ?
I do not find this surprising. The #basic* methods are intended to be fundamental, never overridden, and to reveal the internal structure of an object. This breaks encapsulation, but you need *some* messages that do that or you can't write debugging tools such as inspectors. So it sounds to me like it's correct as is. Regards, -Martin