File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -36,16 +36,17 @@ type constraint may change in this case.
36
36
37
37
= head2 Type Objects
38
38
39
- To test if an object is a type object, test for definedness and check for
40
- identity between the object and its C < .WHAT > pseudo-method. Note that the
41
- method C < .defined > can be overloaded and may provide false information.
39
+ To test if an object is a type object, use L « C < .DEFINITE > |/routine/DEFINITE» method:
42
40
43
41
= begin code :ok-test<WHAT>
44
42
my $a = Int;
45
- say so $a // $a === $a.WHAT ;
43
+ say not $a.DEFINITE ;
46
44
# OUTPUT: «True»
47
45
= end code
48
46
47
+ If it returns C < True > , then the invocant is an instance. If it returns C < False > , then
48
+ the invocant is a type object.
49
+
49
50
= head3 Undefinedness
50
51
51
52
Undefined objects maintain type information in Perl 6. Type objects are used to
You can’t perform that action at this time.
0 commit comments