@@ -2183,6 +2183,38 @@ Note that setting $*TOLERANCE = 0 will cause all comparisons to fail.
2183
2183
say 1 =~= 1; # OUTPUT: «False»
2184
2184
}
2185
2185
2186
+ = head2 infix C « (elem) » , infix C « ∈ »
2187
+
2188
+ multi sub infix:<(elem)>($a,$b --> Bool:D)
2189
+ multi sub infix:<∈>($a,$b --> Bool:D)
2190
+
2191
+ X < Membership operator > .
2192
+
2193
+ Returns C < True > if C < $a > is an B < element > of C < $b > .
2194
+
2195
+ = begin code
2196
+ say 2 (elem) (1, 2, 3); # OUTPUT: «True»
2197
+ say 4 ∈ (1, 2, 3); # OUTPUT: «False»
2198
+ = end code
2199
+
2200
+ C « ∈ » is equivalent to C « (elem) » , at codepoint U+2208 (ELEMENT OF).
2201
+
2202
+ = head2 infix C « ∉ »
2203
+
2204
+ multi sub infix:<∉>($a,$b --> Bool:D)
2205
+
2206
+ X < Non-membership operator > .
2207
+
2208
+ Returns C < True > if C < $a > is B < not > an B < element > of C < $b > . Equivalent to
2209
+ C < !(elem) > .
2210
+
2211
+ = begin code
2212
+ say 4 ∉ (1, 2, 3); # OUTPUT: «True»
2213
+ say 2 !(elem) (1, 2, 3); # OUTPUT: «False»
2214
+ = end code
2215
+
2216
+ C « ∉ » is codepoint U+2209 (NOT AN ELEMENT OF).
2217
+
2186
2218
= head1 Tight AND precedence
2187
2219
2188
2220
= head2 infix C « && »
@@ -3127,28 +3159,6 @@ This summary those operators are included for completeness.
3127
3159
3128
3160
= head2 Operators that return C < Bool >
3129
3161
3130
- = head3 infix (elem)
3131
-
3132
- X < Membership operator > .
3133
-
3134
- Returns C < True > if C < $a > is an B < element > of C < $b > .
3135
-
3136
- = head3 infix ∈
3137
-
3138
- Alternate X < membership operator > , at codepoint U+2208 (ELEMENT OF).
3139
-
3140
- Equivalent to L « (elem)|/routine/(elem) » ,
3141
-
3142
- = head3 infix !(elem)
3143
-
3144
- X < Non-membership operator > .
3145
-
3146
- Returns C < True > if C < $a > is B < not an element > of C < $b > .
3147
-
3148
- = head3 infix ∉
3149
-
3150
- Alternate X < non-membership operator > , at codepoint U+2209 (NOT AN ELEMENT OF).
3151
-
3152
3162
= head3 infix (cont)
3153
3163
3154
3164
X < Contains operator > .
0 commit comments