Skip to content

Commit c4bbda1

Browse files
committed
doc private attributes
1 parent a60d289 commit c4bbda1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/Language/typesystem.pod6

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@ TODO
2424
2525
TODO
2626
27+
=head3 Attributes
28+
29+
=head4 Private Attributes
30+
31+
Private attributes do not have public accessor methods generated automatically.
32+
As such they can not be altered from outside the class they are defined in.
33+
34+
class C {
35+
has $!priv;
36+
submethod BUILD { $!priv = 42 }
37+
};
38+
39+
say (.name, .package, .has_accessor) for C.new.^attributes;
40+
# OUTPUT«($!priv (C) False)␤»
41+
2742
=head3 Methods
2843
2944
=head4 Fallback method

0 commit comments

Comments
 (0)