Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
To #3:

From an end-programmer point of view, there will be no difference between perl 5 type objects and perl 6 type objects. If you treat them as opaque things (which arguably you should, though whether anyone does is a separate matter) your code won't know where objects came from. They could well be tied-in C++ or Smalltalk objects for all the difference it might make.

In actual class declaration, things will be a bit different. While perl 5 objects are just a perl 5 variable with an "I'm an Object!" sticker slapped on them, perl 6 objects will be more structured and, more importantly, safer for subclassing.

Each class in a perl 6 inheritance hierarchy can have its own private data elements (I think we're calling them attributes) that it inserts into the opaque object. Only methods of that class can see the attributes, and the attributes don't clash with like-named attributes from other classes in the hierarchy--all the classes in a tree can have an attribute 'foo' and they're all different attributes, only accessible from within the code of the class that declared it.

These attributes will be fixed at compile-time, per the current thinking, so you're not supposed to be able to add new ones to a class at runtime. (I wouldn't bet too much on not actually being able to, however... :)

Perl 6 classes will be able to inherit from perl 5 classes, and vice versa, as well as from objects from other object systems. Perl 6 classes will likely have a universal parent class, as perl 5 classes do. They won't be the same universal parent class, however. (Whether the perl 6 universal class will be the same as the ruby and python universal base class is still up in the air. We'll see)

Most of the rest of the new toys--overridable dispatching, multimethod dispatching, class-specific multimethods, and stuff like that--will be available to perl 5 classes running under parrot, so I don't know that stuff counts for what you're looking for.

In reply to Re: perl OO - to use or not to use by Elian
in thread perl OO - to use or not to use by kiat

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (4)
    As of 2018-03-19 04:00 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (232 votes). Check out past polls.