in reply to Re: Perl fan being tempted with Python
in thread Perl fan being tempted with Python

What's not native about Perl's OO?
Answer:
bless({}, $class);

The fact that you have to build your own objects reusing other bricks, and some spit named bless gives a strong impression that OO is bolted on to Perl, and not native. A Larry has said, OOP was an experiment in how minimalist one could design OO.

The syntactical sugar for calling methods doesn't make objects "native". There's no object type in Perl, I can't subclass integers or arrays (unless you call the 'tie' mechanism 'subclassing').

I'd call OO in Perl workable. But not native.

Replies are listed 'Best First'.
Re^3: Perl fan being tempted with Python
by ikegami (Pope) on Jun 17, 2005 at 14:55 UTC
    The fact that you have to build your own objects reusing other bricks, and some spit named bless gives a strong impression that OO is bolted on to Perl, and not native.

    Impression? maybe. I'm not sure how that matters. Besides, bless({...}, $class); looks just like new class(...) (C++'s syntax) to me.

    A Larry has said, OOP was an experiment in how minimalist one could design OO.

    True, but this has no bearing on whether objects are native or not.

    The syntactical sugar for calling methods doesn't make objects "native".

    That's an odd statement. Something which is part of the language's syntax is sugar, and not built-in? Acknowkleding it's part of the syntax makes it builtin!

    There's no object type in Perl

    Then how come ref says it's an object?

    I can't subclass integers or arrays (unless you call the 'tie' mechanism 'subclassing').

    You can't do that in C++ or Java either.

      You can't do that in C++ or Java either.

      Exactly, which is why they're not considered "pure OO". I think it comes down to the OP's somewhat ambiguous use of the term "native". It's not clear whether they meant native-as-in-part-of-the-language or naitive-as-in-pure-OO.

      --
      We're looking for people in ATL