[Help-Smalltalk] Metaclass Class model of Smalltalk

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Help-Smalltalk] Metaclass Class model of Smalltalk

MrGwen
Hi,

I want to share an idea about a new model of Metaclass and classes,
I don't want to refactor gst, but just want to know if it seems good!
If we look at the class and metaclass model there this infinite loop
between Metaclass, metaclass of Metaclass, ...
In fact if we try to build the metamodel this is logic:

metaclass of Metaclass -> Metaclass -> ... metaclass of Metaclass ->
Metaclass -> Metaclass of ClassOfThatObject -> ClassOfThatObject ->
anObject

The problem comes from Metaclass need a class, the class also need a
class , ... I think you get it and
this is normal any object in smalltalk has a class.

But what happens if the class of the object  is the object, we get a
prototype (not new) but this
is interesting for building a metaclass/class model:

aPrototype -> Metaclass of ClassOfThatObject -> ClassOfThatObject -> anObject

We could also change the superclass and having two ProtoObject (not
like Pharo/Squeak) but real prototype
which I think should be different for the superclass of
ClassOfThatObject and the metaclass.

This is just an outline of an idea :D

Cheers,
Gwen

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Metaclass Class model of Smalltalk

Paolo Bonzini-2
On 10/21/2010 02:07 PM, Gwenaƫl Casaccio wrote:

> Hi,
>
> I want to share an idea about a new model of Metaclass and classes,
> I don't want to refactor gst, but just want to know if it seems good!
> If we look at the class and metaclass model there this infinite loop
> between Metaclass, metaclass of Metaclass, ...
> In fact if we try to build the metamodel this is logic:
>
> metaclass of Metaclass ->  Metaclass ->  ... metaclass of Metaclass ->
> Metaclass ->  Metaclass of ClassOfThatObject ->  ClassOfThatObject ->
> anObject
>
> The problem comes from Metaclass need a class, the class also need a
> class , ... I think you get it and
> this is normal any object in smalltalk has a class.
>
> But what happens if the class of the object  is the object, we get a
> prototype (not new) but this
> is interesting for building a metaclass/class model:
>
> aPrototype ->  Metaclass of ClassOfThatObject ->  ClassOfThatObject ->  anObject

So the Metaclass would be a prototype of itself?  Doesn't it mean that
"A class class" will see the class-methods of "A", which is wrong?

I think you should think through this more, make an example that works,
and propose it on [hidden email].

Paolo, who's never said "no" so often

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk