Getting rid of metaclasses (Was: Behaviors vs Modules)

Anthony Hannan ajh18 at cornell.edu
Sun Feb 24 17:42:44 UTC 2002


Nathanael <n.schaerli at gmx.net> wrote:
> - A mixin may contain a meta-mixin which defines class side behavior.

I was leaning towards getting rid of metaclasses.  A class reference
like "String" would instead reference the String prototype, and class
methods would be moved to instance methods under an appropriate category
like "instance creation".  Class variables can be replaced by instance
methods that store arbitrary constants, instead of just literals.  This
allows overriding without the need to use class instance variables.  And
the prototype can serve as an example (enhancing documentation) or as a
real prototype to copy.  The prototype (or any instance) would respond
to #new the same as today by creating a brand new instance.  It would
respond to #copy by copying itself.  So the user has a choice.



More information about the Squeak-dev mailing list