protocols, inheritance and polymorphism
jacek.generowicz at cern.ch
Fri Nov 26 11:30:36 CET 2004
Christophe Cavalaria <chris.cavalaria at free.fr> writes:
> Jacek Generowicz wrote:
> > "Dan Perl" <danperl at rogers.com> writes:
> >> Can you elaborate on problems that static languages have with OOP?
> > They make dynamic polymorphism impossible.
> Besides, it's easy to do a 'safe' dynamic_cast, just assert that the
> pointer you get isn't 0 after the cast.
Yes, you can "easily" do the work that the absent dynamic type system
should be doing for you (and Turing equivalence tells us that that we
can implement a decent dynamic type system as well). The fact remains
that the objects *are* *dynamically* typed, even though the language
claims to be statically typed. The fact that statically typed
languages feel the need to introduce dynamic typing (however poorly
supported it may be) in order to support OOP, points to the fact that
static type systems DO have problems with OOP, which is what the
question was about.
Specifically, dynamic polymorphism is impossible without dynamic
More information about the Python-list