[squeak-dev] Additional comments on Object>>is:

Tony Garnock-Jones tonyg at lshift.net
Fri Mar 5 19:51:20 UTC 2010


Andreas Raab wrote:
> This certainly avoids the dependency and I'd be okay to use it. However,
> actually taking the numbers in Cuis points out that 19 out of 21
> implementors of #is: use their class name as the only tag (I haven't
> looked at the 130 or so senders but I suspect a very similar ratio). In
> other words, we have a > 90% correlation between the use of #is: and the
> receiver's type. Given that high correlation I think it's worthwhile to
> support it out of the box.

The only concern I have with this is that it counts only positives, not
negatives, so to speak. It's making a protocol out of *every* class,
even those not currently used as protocols.

To look at it from a "negatives" point of view, there are 1262
subclasses of ProtoObject in Cuis 2.2, of which only 21 (1.7%) implement
#is:, so that's 1241 implicitly-defined protocols that there are no
users of.

This is why I think that being explicit about what an object #is: is
better than having it default to class names.

Regards,
  Tony



More information about the Squeak-dev mailing list