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

Chris Cunnington smalltalktelevision at gmail.com
Fri Oct 12 19:12:38 UTC 2012


On Fri, Oct 12, 2012 at 2:27 PM, Frank Shearar <frank.shearar at gmail.com>wrote:

> 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 :) )
>

Absolutely. I knew there was a wrinkle I wasn't seeing. :)

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20121012/2943e5de/attachment.htm


More information about the Squeak-dev mailing list