Skip to content

Commit 598d950

Browse files
committed
Modifies example to use only spaces
And, just maybe, closes 1780
1 parent 53c012a commit 598d950

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/Language/objects.pod6

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,16 +258,17 @@ L<Re-dispatching|/language/functions#Re-dispatching>.
258258
259259
You may write your own accessors to override any or all of the autogenerated ones.
260260
261+
my $ⲧ = " " xx 4;
261262
class Journey {
262263
has $.origin;
263264
has $.destination;
264265
has @.travelers;
265266
has Str $.notes is rw;
266267
267268
multi method notes() { "$!notes\n" };
268-
multi method notes( Str $note ) { $!notes ~= "$note\n\t" };
269+
multi method notes( Str $note ) { $!notes ~= "$note\n$ⲧ" };
269270
270-
method Str { "⤷ $!origin\n\t" ~ self.notes() ~ "$!destination ⤶\n" };
271+
method Str { "⤷ $!origin\n$ⲧ" ~ self.notes() ~ "$!destination ⤶\n" };
271272
}
272273
273274
my $trip = Journey.new( :origin<Here>, :destination<There>,
@@ -277,13 +278,14 @@ You may write your own accessors to override any or all of the autogenerated one
277278
$trip.notes("Almost there");
278279
print $trip;
279280
280-
# Will print
281+
# OUTPUT:
281282
#⤷ Here
282-
# First steps
283-
# Almost there
283+
# First steps
284+
# Almost there
284285
#
285286
#There ⤶
286287
288+
287289
The declared multi method C<notes> overrides the auto-generated
288290
methods implicit in the declaration of C<$.notes>, using a different
289291
signature for reading and writing.

0 commit comments

Comments
 (0)