Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tweak grammar and text
  • Loading branch information
tbrowder committed Jul 27, 2018
1 parent 7f99159 commit e664ce4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc/Language/classtut.pod6
Expand Up @@ -41,7 +41,7 @@ X<|Submethod>
You can also provide your own construction and C<BUILD>
implementation. The following, more elaborate example shows how a
dependency handler might look in Perl 6. It showcases custom
constructors, private and public attributes, L<Submethod>s, methods and
constructors, private and public attributes, L<Submethod>s, methods, and
various aspects of signatures. It's not a lot of code, and yet the
result is interesting and useful.
Expand Down Expand Up @@ -94,12 +94,12 @@ to the two attributes, C<&!callback> and C<@!dependencies>, and returns
the object (or turns it in to the next phase, C<TWEAK>, if available).
Declaring C<new> as a C<method> and not a C<multi method> prevents us
from using the default constructor; tis implicit constructor uses the
from using the default constructor; this implicit constructor uses the
attributes as named parameters. That is one of the reasons why using
C<new> is discouraged. If you need to declare it anyway, use C<multi
method new> if you do not want to disable the default constructors.
C<TWEAK> is the last submethod to be called, and it has got the
C<TWEAK> is the last submethod to be called, and it has the
advantage of having the object properties available without needing to
use the meta object protocol. It can be used, for instance, to assign
values to instance variables based on the values of other attributes or
Expand All @@ -123,7 +123,7 @@ say Str-with-ID.new(string => 'Second').ID; # OUTPUT: «1»
In this case, we need to compute C<$.ID> from the value of a counter that is a
class variable, C<$.counter>, thus we simply assign a value to it and increment
the counter at the same time. Please check also
L<this section on C<TWEAK> in the OO document|/language/objects#index-entry-TWEAK>
L<this section on C<TWEAK> in the Object Orientaion (OO) document|/language/objects#index-entry-TWEAK>
for the mechanics of object construction.
=head1 Starting with class
Expand Down Expand Up @@ -166,7 +166,7 @@ or a type object:
say Foo.DEFINITE; # OUTPUT: «False␤» (type object)
say Foo.new.DEFINITE; # OUTPUT: «True␤» (instance)
You can also use type smileys to only accept instances or type objects:
You can also use type "smileys" to only accept instances or type objects:
multi foo (Int:U) { "It's a type object!" }
multi foo (Int:D) { "It's an instance!" }
Expand All @@ -185,7 +185,7 @@ variable cannot be accessed from outside its declared scope, attributes are
not accessible outside of the class. This I<encapsulation> is one of the
key principles of object oriented design.
The first declaration specifies instance storage for a callbacka bit of
The first declaration specifies instance storage for a callback--a bit of
code to invoke in order to perform the task that an object represents:
=for code
Expand Down

0 comments on commit e664ce4

Please sign in to comment.