Skip to content

Commit 616218a

Browse files
committed
Minor changes, deindent, reflow
1 parent 76ffe3a commit 616218a

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

doc/Language/classtut.pod6

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@ In the two classes, the default constructor is being used. This
3737
constructor will use named parameters in its invocation: C«Point.new(x =>
3838
0, y => 0)».
3939
40-
X<|Submethod>
41-
You can also provide your own construction and C<BUILD>
42-
implementation. The following, more elaborate example shows how a
43-
dependency handler might look in Perl 6. It showcases custom
44-
constructors, private and public attributes, L<Submethod|/type/Submethod>s, methods, and
45-
various aspects of signatures. It's not a lot of code, and yet the
46-
result is interesting and useful.
40+
You can also provide your own construction and C<BUILD> implementation. The
41+
following, more elaborate example shows how a dependency handler might look in
42+
Perl 6. It showcases custom constructors, private and public attributes,
43+
L<Submethod|/type/Submethod>s, methods, and various aspects of signatures. It's
44+
not a lot of code, and yet the result is interesting and useful.
4745
4846
=begin code
4947
class Task {
@@ -296,18 +294,16 @@ to do this.
296294
Perl 6 has no B<static> keyword. Nevertheless, any class may declare anything
297295
that a module can, so making a scoped variable sounds like good idea.
298296
299-
=begin code
300-
301-
class Singleton {
302-
my Singleton $instance;
303-
method new {!!!}
304-
submethod instance {
305-
$instance = Singleton.bless unless $instance;
306-
$instance;
307-
}
297+
=begin code
298+
class Singleton {
299+
my Singleton $instance;
300+
method new {!!!}
301+
submethod instance {
302+
$instance = Singleton.bless unless $instance;
303+
$instance;
308304
}
309-
310-
=end code
305+
}
306+
=end code
311307
312308
Class attributes defined by L<my|/syntax/my> or L<our|/syntax/our> may also be
313309
initialized when being declared, however we are implementing the Singleton
@@ -316,11 +312,11 @@ possible to predict the moment when attribute initialization will be executed,
316312
because it can take place during compilation, runtime or both, especially when
317313
importing the class using the L<use|/syntax/use> keyword.
318314
319-
=begin code :preamble<class Foo {}; sub some_complicated_subroutine {}>
320-
class HaveStaticAttr {
321-
my Foo $.foo = some_complicated_subroutine;
322-
}
323-
=end code
315+
=begin code :preamble<class Foo {}; sub some_complicated_subroutine {}>
316+
class HaveStaticAttr {
317+
my Foo $.foo = some_complicated_subroutine;
318+
}
319+
=end code
324320
325321
Class attributes may also be declared with a secondary sigil – in a similar
326322
manner to object attributes – that will generate read-only accessors if the
@@ -795,4 +791,4 @@ it in a narrative way.
795791
796792
=end pod
797793

798-
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
794+
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)