first class method categories (was Re: WTF is a trait?)
Avi Bryant
avi.bryant at gmail.com
Sat Sep 3 21:53:08 UTC 2005
On Sep 3, 2005, at 1:42 PM, stéphane ducasse wrote:
>
> A trait is not a run-time entity, just a first class method category.
As I was saying to Daniel a few days ago, I'd love to see tools that
really emphasized this view of traits. I want creating a trait to
feel almost exactly like creating a method category: you should just
be able to choose "new trait" from the method category column of a
browser, give it a name, and see it show up there with the other
categories. Until you add the same trait to some other class, it
should be exactly as if it was just a category, just with different
naming conventions. I should be able to drag a category/trait from
the method category column of one class to another, to share the
trait. The extra pieces of metadata for a particular application of
a trait - aliases, removals - can appear in the text pane of the
browser when I select that trait in the category column, and be
editable there, rather than being shoved into the class definition.
I think this would be a much lower-impact, more familiar way of
integrating traits into the traditional Smalltalk mindset and
workflow than treating them as part of the inheritance hierarchy, as
they are now.
Avi
More information about the Squeak-dev
mailing list
|