I
Ian Kelly
....Well that bumps our count to five then:
Six.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: type 'ellipsis' is not an acceptable base type
....Well that bumps our count to five then:
Six.
Well that bumps our count to five then:
--> NoneType = type(None)
--> NoneType
<class 'NoneType'>
--> class MoreNone(NoneType):
... pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: type 'NoneType' is not an acceptable base type
Actually, I'm not sure how you'd go about inheriting from a function.
Why not just create a bare class, then assign its __call__ to be the
function you're inheriting from?
I think his point remains valid, from a theoretical pov. Python
prides itself on the idea of "first-class functions" and such, but
unlike the world of lambda calculus, this selling point is a bit
invalid. Because for Python (and any C-based language), it is roots
squarely in the Turing machine and its real-word implementation.
(Note this contrasts starkly with Java(script), which doesn't seem
to be based on anything -- can anyone clarify where Java actually
comes from?)
I think his point remains valid, from a theoretical pov. Python prides
itself on the idea of "first-class functions" and such, but unlike the
world of lambda calculus, this selling point is a bit invalid.
Because for Python (and any C-based language),
it is roots squarely in the
Turing machine and its real-word implementation.
(Note this contrasts starkly with Java(script), which doesn't seem
to be based on anything -- can anyone clarify where Java actually comes
from?)
I see. It seems I have underestimated the work involved.As a practical matter, the change is non-trivial. Someone has to be
motivated to write the patch to enable subclassing, write tests, and
consider the effect on internal C uses of slice and stdlib Python used
of slice (type() versus isinstance).
Did the idea actually require that instances *be* a slice rather than
*wrap* a slice?
And kept the worst features of each... <G>"Influenced by: Ada 83, C++, C#, Eiffel, Generic Java, Mesa, Modula-3,
Oberon, Objective-C, UCSD Pascal, Smalltalk"
"Categories: C programming language family | [...]"
– http://en.wikipedia.org/wiki/Java_(programming_language)
(Note this contrasts starkly with Java(script), which doesn't seem
to be based on anything -- can anyone clarify where Java actually
comes from?)
Java is not equal in any way with JavaScript. The only thing
they share are semicolons and braces. Naming EMCAScript
JavaScript was a very unfortunate thing indeed.
For the record, JavaScript is what they call a "prototype-based
language." http://en.wikipedia.org/wiki/Prototype-based_programming.
You can emulate an OOP system with a prototype-based language.
I highly recommend you read a book on formal programming
language theory and concepts.
For the record, JavaScript is what they call a "prototype-based
language." http://en.wikipedia.org/wiki/Prototype-based_programming.
You can emulate an OOP system with a prototype-based language.
Steven D'Aprano said:Prototype languages *are* OOP. Note that it is called OBJECT oriented
programming, not class oriented, and prototype-based languages are based
on objects just as much as class-based languages. They are merely two
distinct models for OOP.
different people. All of whom believe with religious fervor that they
know the true answer.
Here's a simple rule to resolve the ambiguity. Whoever publishes
first, gets to claim origin of a word and its usage, kind of like a
BDFL. The rest can adapt around that, make up their own word, or be
corrected as the community requires.
You won't solve the problem of confusing, ambiguous, or conflicting
terminology by making up a rule. "Object-oriented" means subtly different
things to different people.
It turns out that computing is a complex field
with subtle concepts that don't always fit neatly into a categorization.
Python, Java, Javascript, Ruby, Smalltalk, Self, PHP, C#, Objective-C, and
C++ are all "object-oriented", but they also all have differences between
them. That's OK. We aren't going to make up a dozen words as alternatives
to "object-oriented", one for each language.
You seem to want to squeeze all of computer science and programming into a
tidy hierarchy.
It won't work, it's not tidy. I strongly suggest you read
more about computer science before forming more opinions. You have a lot to
learn ahead of you.
--Ned.
That's a problem, not a solution.
But that is the point of having a *field*.
Well, you won't, but other people *in the field* already have,
fortunately. They have names like dynamically-typed, statically-typed,
etc.
That all being said, the thrust of this whole effort is to possibly
advance Computer Science and language design, because in-between the
purely concrete "object" architecture of the imperative programming
languages and the purely abstract object architecture of
object-oriented programming languages is a possible middle ground that
could unite them all.
You seem to want to squeeze all of computer science and programming into a
tidy hierarchy. It won't work, it's not tidy. I strongly suggest you read
more about computer science before forming more opinions. You have a lot to
learn ahead of you.
Done: see the wikiwikiweb: http://c2.com/cgi/wiki?ComputerScienceVersionTwo
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.