Re: Re: Re: Re[2]: Re: class proposal

Lenard Lindstrom <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <Mahogany-0.66.0-4294655545-20040629-103702.00@pop3.norton.antivirus>
On Mon, 28 Jun 2004 20:44:17 -0700 Mark Hahn <[email protected]> wrote:

> 
> You have explained how Python metaclasses work.  I was asking for something
> metaclasses can do that Prothon cannot do.
> 
> Serge gave me a reference to some metaclass examples.  I am in the process
> of trying to understand them and see how Prothon would deal with them.
> Serge himself says that metaclasses are only decorators, whatever that
> means.
>
Okay. I have not explored prototypes fully enough to know just what they can
and cannot do. Some of C-Python's metaclass capabilities are really due to its
low level type system. Also it is easy to confuse what is accomplished with
metaclasses with attribute lookup overriding. I will retract my comment for
now.

> >> The more I learn about Python's interpreter the more I learn there
> >> isn't much difference.  You seem to think there is a big difference
> >> in this "type" business but I'm not convinced.  I suspect it is just
> >> a vestige left over from the old Python design.
> >>
> > They let Python C extension modules customize an object in attribute
> > lookup
> > and memory management. One could add new object types to Python by
> > writing
> > a module.
> 
> Ah, I understand now.  I don't really care for that feature.  Has anyone
> made good use of the capability?
>
Customized attribute lookup is used by ctypes to make dll functions look
like object attributes. The win32 module does the same with COM interfaces.
The weakref module has a proxy object.

> > I see Prothon's strengths being native thread support and builtin
> > i18n. So Prothon should be designed for those applications where
> > these features are important. Maybe compatiblity with Python should
> > not be a consideration at
> > all?
> 
> It never was.  I've always said that Prothon would never be compatible with
> Python.
> 
In that case :-)

What I dislike about Python:

1) Case sensitive identifiers. This is a C holdover. Many high level languages
   - Pascal, Ada, PL/I - are case insensitive. Why not Prothon? Just rename
   Object to root to remove the conflict with the object statement.

2) That colon terminating the first line of block statements. It makes python
   blocks half delimited. It is only there for readability and to make life easier
   for editor writers. It is an irritant to me. Either add a block terminator
   or make the colon optional when the block starts on a new line.

3) The inequality operator != . Lets either adopt Pascal's <> for not equal and :=
   for assignment, or C's &&, ||, and !.

This is enough to start with. More will probably come to mind.

Lenard Lindstrom
<[email protected]>
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.