Skip to content

Commit 89b0310

Browse files
committed
Update objects.pod6 with further refinements, simplification, clarification of section on attribute mutator methods.
1 parent 7abcd9a commit 89b0310

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

doc/Language/objects.pod6

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -297,25 +297,24 @@ Method names can be resolved at runtime with the C<.""> operator.
297297
# OUTPUT: «(Any)␤»
298298
299299
The syntax used to update C<$.notes> changed in this section with respect
300-
to the previous L<#Attributes> section. Instead of:
300+
to the previous L<#Attributes> section. Instead of an assignment:
301301
302302
$vacation.notes = 'Pack hiking gear and sunglasses!';
303303
304-
we now:
304+
we now do a method call:
305305
306306
$trip.notes("First steps");
307307
308308
Overriding the default auto-generated accessor means it is no longer
309-
available to provide a mutable container on return, and the new update
310-
method is called to set the attribute rather than an assignment.
311-
Using a method call is the preferred approach to adding computation
312-
and logic to the update of an attribute. Many modern languages can
313-
update an attribute by overloading assignment with a “setter” method.
314-
While Perl 6 can overload the assignment operator for this purpose
315-
with a
309+
available to provide a mutable container on return for an assignment.
310+
A method call is the preferred approach to adding computation and
311+
logic to the update of an attribute. Many modern languages can update
312+
an attribute by overloading assignment with a “setter” method. While
313+
Perl 6 can overload the assignment operator for this purpose with a
316314
L<C<Proxy>|https://github.com/perl6/roast/blob/master/S12-attributes/mutators.t>
317315
object, overloading assignment to set attributes with complex logic is
318-
currently discouraged as weaker OO design.
316+
currently discouraged as
317+
L<weaker object oriented design|https://6guts.wordpress.com/2016/11/25/perl-6-is-biased-towards-mutators-being-really-simple-thats-a-good-thing/>.
319318
320319
=head2 Class and Instance Methods
321320

0 commit comments

Comments
 (0)