[squeak-dev] Traits as a way of defining an interface instead of an abstract superclass

Frank Shearar frank.shearar at gmail.com
Fri Oct 12 18:27:17 UTC 2012


On 12 October 2012 17:42, Chris Cunnington
<smalltalktelevision at gmail.com> wrote:
> On 12-10-12 12:26 PM, Frank Shearar wrote:
>>
>> On 12 October 2012 17:21, Chris Cunnington
>> <smalltalktelevision at gmail.com> wrote:
>>>
>>> I've been looking at MetaObjects's [1] decade old implementation of the
>>> vm
>>> in Cocoa. It has a class called SqueakInterpreter.h that defines a
>>> protocol
>>> that is used in SqView. The selectors are listed in SqueakInterpreter.h
>>> but
>>> implemented in SqView.m. I believe this kind of thing is now called a
>>> category in Objective-C-ese. And I was wondering why somebody would do
>>> this?
>>> We don't separate the protocols from the classes in Smalltalk. And I
>>> think
>>> the reason is we use abstract superclasses. And we have deep user
>>> developed
>>> hierarchies.
>>
>> Protocols allow you to say "these messages, unrelated by inheritance,
>> nevertheless both understand these sets of messages".
>
> There's something dicey about this wording, I feel. Messages don't
> understand messages. Objects do. "These objects, unrelated by inheritance,
> nevertheless both understand these sets of messages." Perhaps?

Er yes, that's what I had _meant_ to type.

(But of course Message instances are objects, and understand messages :) )

frank


More information about the Squeak-dev mailing list