in reply to Why perl is more OO than C++ or Java...

I've also noticed that there's a fine line between ATD's (Abstract Data Types) and Classes. A class is a way to create your own ATD's, though all languages have built-in ATD's.

I also note that the Perl scalar, unlike a C primitive type, is polymorphic. A function can do different things depending on its actual content at run-time, which could be a string, float, int, hash, or undef.

Scalars can also be tied. So you are indeed calling FETCH as an abstract interface, which could have any of a number of implementations behind it, including the built-in normal one.

As for your 4th paragraph, you make a case that any "higher level" language indeed treats variables and values as objects. However, simple languages like old BASIC don't provide for OO programming because you don't create your own object types as a means to solve a problem. That's a crutial difference—a few built-in objects as part of the language definition doesn't allow you to take an OO approach in programming.

—John

  • Comment on Re: Why perl is more OO than C++ or Java...