@@ -22,25 +22,54 @@ List or a list-like type.
22
22
23
23
Returns C < True > if C < $other === self > (i.e. it checks object identity).
24
24
25
+ Many built-in types override this for more specific comparisons
26
+
25
27
= head2 method any
26
28
27
- Interprets the invocant as a list and creates an C < any > -Junction from it.
29
+ method any() returns Junction:D
30
+
31
+ Interprets the invocant as a list and creates an
32
+ C < any > -L < Junction|/type/Junction > from it.
33
+
34
+ say so 2 == <1 2 3>.any; # True
35
+ say so 5 == <1 2 3>.any; # False
28
36
29
37
= head2 method all
30
38
31
- Interprets the invocant as a list and creates an C < all > -Junction from it.
39
+ method all() returns Junction:D
40
+
41
+ Interprets the invocant as a list and creates an
42
+ C < all > -L < Junction|/type/Junction > from it.
43
+
44
+ say so 1 < <2 3 4>.all; # True
45
+ say so 3 < <2 3 4>.all; # False
32
46
33
47
= head2 method one
34
48
35
- Interprets the invocant as a list and creates an C < one > -Junction from it.
49
+ method one() returns Junction:D
50
+
51
+ Interprets the invocant as a list and creates an
52
+ C < one > -L < Junction|/type/Junction > from it.
53
+
54
+ say so 1 == (1, 2, 3).one; # True
55
+ say so 1 == (1, 2, 1).one; # False
36
56
37
57
= head2 method none
38
58
39
- Interprets the invocant as a list and creates an C < none > -Junction from it.
59
+ method none() returns Junction:D
60
+
61
+ Interprets the invocant as a list and creates an
62
+ C < none > -L < Junction|/type/Junction > from it.
63
+
64
+ say so 1 == (1, 2, 3).none; # False
65
+ say so 4 == (1, 2, 3).none; # True
40
66
41
67
= head2 method list
42
68
43
- Interprets the invocant as a list, and returns that list.
69
+ Interprets the invocant as a list, and returns that L < List|/type/List > .
70
+
71
+ say so 42.list.^name; # List
72
+ say so 42.list.elems; # 1
44
73
45
74
= head2 method flat
46
75
@@ -54,15 +83,23 @@ Interprets the invocant as a list, flattens it, and returns that list.
54
83
Interprets the invocant as a list, evaluates it eagerly, and returns that
55
84
list.
56
85
86
+ say (1..10).eager; # 1 2 3 4 5 6 7 8 9 10
87
+
57
88
= head2 method elems
58
89
59
90
Interprets the invocant as a list, and returns the number of elements in the
60
91
list.
61
92
93
+ say 42.elems; # 1
94
+ say <a b c>.elems; # 3
95
+
62
96
= head2 method end
63
97
64
98
Interprets the invocant as a list, and returns the last index of that list.
65
99
100
+ say 6.end; # 0
101
+ say <a b c>.end; # 2
102
+
66
103
= head2 sub exit
67
104
68
105
sub exit(Int() $status = 0)
0 commit comments