Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added docs for method 'isa' in Mu. #perl6++
  • Loading branch information
Jan-Olof Hendig committed May 23, 2016
1 parent fcd329e commit 1fb27c0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/Type/Mu.pod
Expand Up @@ -32,6 +32,22 @@ C<False> even for instances:
sub fails() { fail 'oh noe' };
say fails().defined; # False
=head2 routine isa
multi method isa(Mu $type) returns Bool:D
multi method isa(Str:D $type) returns Bool:D
Returns C<True> if the invocant is an instance of class C<$type>, a subset type or a derived class (through inheritance) of C<$type>.
my $i = 17;
say $i.isa("Int"); # True
say $i.isa(Any); # True
A more idiomatic way to do this is to use the smartmatch operator L<~~|/routine/~~> instead.
my $s = "String";
say $s ~~ Str; # True
=head2 routine Bool
multi sub Bool(Mu) returns Bool:D
Expand Down

0 comments on commit 1fb27c0

Please sign in to comment.