Re: Why Python When There Is Perl?

Liste des GroupesRevenir à ol advocacy 
Sujet : Re: Why Python When There Is Perl?
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.advocacy
Date : 03. Apr 2024, 09:48:33
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uuj1kh$3phh2$7@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Pan/0.155 (Kherson; fc5a80b8)
On Tue, 2 Apr 2024 08:51:57 -0400, Chris Ahlstrom wrote:

Lawrence D'Oliveiro wrote this copyrighted missive and expects
royalties:
 
On Sun, 24 Mar 2024 09:39:21 -0400, Chris Ahlstrom wrote:
>
C++ can do template metaprogramming.
>
Python doesn’t need two different languages for “compile-time” versus
“run-time” programming; it uses the same language for both.
 
I think that Alexander Stepanov would say..... [some incomprehensible
C++ technical term]

Also, consider enums. I think C++ only has the old, boring, C-style enums.
Java managed to introduce quite an advanced enum facility, with the
ability to attach custom methods and attributes to enum instances.

Python offers the same sort of thing as Java. Only, whereas Java enums are
a feature that is built into the core language, Python does it as a
standard library module, written in pure Python.

How do we do it? Metaclasses! (Also descriptors help.)

Function definitions and class definitions are not declarations: they
are just forms of assignment statement.
>
And then there are metaclasses ...
 
I wonder if the C++ metaclass proposal ever made it into C++. Will have
to check....

I’ll be waiting.

Date Sujet#  Auteur
2 Oct 24 o 

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal