We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fcd329e commit 1fb27c0Copy full SHA for 1fb27c0
doc/Type/Mu.pod
@@ -32,6 +32,22 @@ C<False> even for instances:
32
sub fails() { fail 'oh noe' };
33
say fails().defined; # False
34
35
+=head2 routine isa
36
+
37
+ multi method isa(Mu $type) returns Bool:D
38
+ multi method isa(Str:D $type) returns Bool:D
39
40
+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>.
41
42
+ my $i = 17;
43
+ say $i.isa("Int"); # True
44
+ say $i.isa(Any); # True
45
46
+A more idiomatic way to do this is to use the smartmatch operator L<~~|/routine/~~> instead.
47
48
+ my $s = "String";
49
+ say $s ~~ Str; # True
50
51
=head2 routine Bool
52
53
multi sub Bool(Mu) returns Bool:D
0 commit comments