Skip to content

Commit 79411a9

Browse files
authored
In classtut.rakudoc, add links plus a clarifying sentence about trait is built(False) (#4694)
1 parent 37aac50 commit 79411a9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/Language/classtut.rakudoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ again), you can change the attribute declaration:
166166
=for code
167167
has Bool $.done is rw;
168168

169-
The C<is rw> trait causes the generated accessor method to return a container
169+
The L<C<is rw>|/type/Attribute#trait_is_rw> trait causes the generated accessor method to return a container
170170
so external code can modify the value of the attribute.
171171

172172
=head2 C<is built> trait
@@ -177,10 +177,11 @@ has &!callback is built;
177177
X<|Types,traits;Types,is built>
178178
By default private attributes are not automatically set by the default constructor. (They are private after
179179
all.) In the above example we want to allow the user to provide the initial value but keep the attribute
180-
otherwise private. The C<is built> trait allows to do just that.
180+
otherwise private. The L<C<is built>|/type/Attribute#trait_is_built> trait allows to do just that.
181181

182-
One can also use it to do the opposite for public attributes, i.e. prevent them to be automatically
183-
initialized with a user provided value, but still generate the accessor method:
182+
One can use the same trait C<is built> to do the opposite for public attributes, i.e. prevent them from being
183+
automatically initialized with a user-provided value, but still generate the accessor method. This is done by giving
184+
the argument C<False> to the trait:
184185

185186
=for code
186187
has $.done is built(False);

0 commit comments

Comments
 (0)