prototypes (was: A little namespace "proposal")

Jecel Assumpcao Jr jecel at merlintec.com
Tue Apr 6 17:33:23 UTC 2004


On Tuesday 06 April 2004 13:07, Roel Wuyts wrote:
> Wait - you were taking my post too literal.
> Foo::Bar syntax is like one name 'Foo:Bar', which has two parts. So
> for me it is not a syntax for a message send.
>
> Squeak is a class-based object-oriented languages, yes, in which you
> have classes that act as blueprints for creating methods (etc. etc).

I might be totally wrong here, but this might be the root of the current 
discussion. Andreas is thinking about Tweak and there is a natural 
tendency to give such direct manipulation programming systems a more 
prototype flavor. See ARK (the Alternate Reality Kit), the father of 
Self. This leads to a different perspective on name spaces than a 
purely text based and class based background would.

> I know there is other beasts around, like Self or Javascript or Agora
> or Kevo or ... for example, that use prototypes, cloning and
> delegation. If you take Self or Kevo, which are quite interesting,
> you'll note that they have introdued class-like mechanisms because
> there was a real need for this.

Not really, unless you count the "copy down slots" in the Self 
programming environment.

> So, you only have objects
> (prototypes), but some of them act like classes, some of them act
> like traits, some of them act like maps (families in Kevo),

Maps are an implementation detail and 100% invisible to the programmer.

> and some
> of them as regular, user objects.

You forgot mirrors :-)

> If there is a real need for such
> different concepts, why not give them clear separate names and use
> them accordingly?

Two very good reasons:

1) simplicity - note that Squeak only has regular classes and makes you 
do tricks like #subclassResponsibility in order to implement abstract 
classes as present in other languages. Doing things by convention 
instead of explict language feature keeps the complexity down to a 
reasonable level.

2) flexibility - an object in Self can be both what you called a regular 
object and a trait at the same time. Or it can start as one and change 
into the other as the program evolves. Making everything separate 
limits what you can do.

-- Jecel



More information about the Squeak-dev mailing list