Re: class proposal 2

Paul Prescod <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
Mark Hahn wrote:

>...
> There will be a class object for each class.  

I have mixed feelings about having BOTH prototypes AND classes in the 
same language...

>...
> There will also be a factory object for each class.  Ironically this object
> will represent the class itself instead of the instances even though it is
> not the "class object".  Class methods and class variables will be stored
> here especially the "call_" method that implements the "Class()"
> constructor.  I will explain how this works in a moment.  This gives a
> seperate namespace for class attributes.

What about inheritance between class attributes? Is there any?

> If the Class object is called "Klass", then the factory object would be
> stored in it's attribute as "Klass.class".

I wouldn't call it a factory because the overall class is the factory. 
It is really the container for class attributes.

> ---  When an attribute is first being looked up in an immediate object, not
> an ancestor, and a attribute named "class" exists in the immediate object,
> that class attribute object is used in the object's place for the
> lookup. ---

What does "first being looked up" mean? What exactly is the order of 
lookup? Klass.class.foo and then Klass.foo? Or just Klass.class.foo?

Do the instance objects inherit the "class" at all? Or is it just gone?

One of the nice things about Python is that str_ and call_ for classes 
do the "right thing" by default no matter what happens for instances. 
Does your proposal have that feature?

  Paul Prescod
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.