Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add clarity (hopefully--please review)
  • Loading branch information
tbrowder committed Dec 12, 2016
1 parent a103ca2 commit d174a94
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/Language/classtut.pod6
Expand Up @@ -107,23 +107,23 @@ X<|type object>
X<|defined>
X<|.defined>
Declaring a class creates a I<type object> which, by default, is installed into
Declaring a class creates a new I<type object> which, by default, is installed into
the current package (just like a variable declared with C<our> scope). This
type object is an "empty instance" of the class. For example, types such as
C<Int> and C<Str> refer to the type object of one of the Perl 6 built-in
classes. The example above uses the class name C<Task> so that other code can
refer to it later, such as to create class instances by calling the C<new>
method.
Type objects are I<undefined>, in the sense that they return C<False> if you
Built-in type objects are I<undefined>, in the sense that they return C<False> if you
call the C<.defined> method on them. You can use this method to find out if
a given object is a type object or not:
my $obj = Int;
if $obj.defined {
say "Ordinary, defined object";
say "Ordinary, user-defined object";
} else {
say "Type object";
say "Built-in type object";
}
=head1 State
Expand Down

0 comments on commit d174a94

Please sign in to comment.