Protocol dilution?

Peter Smet peter.smet at
Tue Dec 15 23:14:50 UTC 1998

I actually find Object do: extremely handy. It's kind of like the
composite pattern. I use it mainly to pass an argument to a
selector, where the argument may be either a single argument
or a collection of arguments (you don't know which). Whatever
the case, you can extract the argument(s) by sending it do:
(Are there any other neat ways of achieving this in Smalltalk -
ie a method that handles either a leaf or a composite?)

Notice that this won't work with in:, since the collection protocol
is different. It is useful to have a method that makes an atom transparently
act like a collection of atoms.

I can't remember the justification for wanting to remove do:,
something about confusing error messages and difficult debugging.


-----Original Message-----
From: Marcel Weiher <marcel at>
To: squeak at <squeak at>
Date: Wednesday, December 16, 1998 4:40 AM
Subject: Protocol dilution?

>Hi folks,
>did any kind of consensus emerge on the protocol dilution issue?  I
>see Object>>do: still has the comment that it's obsolete and #in:
>should be used instead.  On the other hand, various numeric and other
>operations have been added to the Collection protocol (I am assuming
>that they weren't there before).

More information about the Squeak-dev mailing list