I've seen the term "protocol" bandied about in documentation, and I understand it to refer to the entire set of methods exported by a class. Is there a corresponding language-feature that aggregates sets of methods (or just their interfaces) such that they can be added to a class, like a mixin
Hi
On 1 août 04, at 11:15, Marcin Tustin wrote:
I've seen the term "protocol" bandied about in documentation,
and I understand it to refer to the entire set of methods exported by a class. Is there a corresponding language-feature that aggregates sets of methods (or just their interfaces) such that they can be added to a class, like a mixin
Not in the current Smalltalk implementation but you may be interested by Traits. http://www.aim.unibe.ch/~scg/Research/Traits.html
Traits are working for 3.7.
Stef
Am 01.08.2004 um 11:15 schrieb Marcin Tustin:
I've seen the term "protocol" bandied about in documentation,
and I understand it to refer to the entire set of methods exported by a class. Is there a corresponding language-feature that aggregates sets of methods (or just their interfaces) such that they can be added to a class, like a mixin
No. Protocols are only used for documentation. So it's just a feature of the development environment to allow the developers to sort methods to not get confused.
Categories are no objects, and they have no semantic meaning for the language.
If you want "mixin" like functionality, have a look at Traits:
http://www.iam.unibe.ch/~scg/Research/Traits/
There is now a new implementation of Traits that you can load with the Package Loader (package Traits). This recompiles the whole image, so installation will take some time.
Marcus
squeak-dev@lists.squeakfoundation.org