Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

[Perl 6] Class Attributes

by John M. Dlugosz (Monsignor)
on Aug 12, 2008 at 11:52 UTC ( #703877=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://703877]
Approved by ikegami
Front-paged by ruoso
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2023-05-29 18:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?