Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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

Comment on [Perl 6] Class Attributes
Download Code
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.
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.

Log In?
Username:
Password:

What's my password?
Create A New User
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 taking refuge in the Monastery: (10)
As of 2014-12-29 15:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (192 votes), past polls