http://qs321.pair.com?node_id=703877

John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:

Can someone help me figure out what the Synopses S12 means concerning "Class" attributes?

our $.attrib; our $!attrib;
Are the access methods generated on the Class object or on this object? If the former, what does "inherited" mean? And on the second example above, what does it mean that the attribute is inherited, if there are no accessors?

—John

Replies are listed 'Best First'.
Re: [Perl 6] Class Attributes
by ruoso (Curate) on Aug 12, 2008 at 14:01 UTC

    There's no "inherited attributes" in Perl 6. What you have is inherited accessors.

    our $.attrib is actually the same as...

    our $!attrib; # but it keeps the original name stored for introspecti +on... method attrib { $!attrib }
    daniel
      I know. So, what does "inherited" mean if there are no accessors? That's what S12 says.
        Can you please cut/paste the relevant text.
Re: [Perl 6] Class Attributes
by Anonymous Monk on Aug 12, 2008 at 12:03 UTC
    Are the access methods generated on the Class object or on this object?
    What difference does it make? I ask because S12 says Attributes are stored in an opaque datatype, not in a hash. Not even the class has to care how they're stored, since they're declared much like ordinary variables.
      What difference does it make? Whether you call it with $obj.a or $obj.^a.