infix (elem)

Documentation for infix (elem), assembled from the following types:

language documentation Sets, Bags, and Mixes

From Sets, Bags, and Mixes

(Sets, Bags, and Mixes) infix (elem)

multi sub infix:<(elem)>($aAny $b --> Bool)
multi sub infix:<(elem)>($aSet $b --> Bool)

Membership operator.

Returns True if $a is an element of $b.

say 2 (elem) (123).Set;              # OUTPUT: «True␤» 
say 4 (elem) (123).Set;              # OUTPUT: «False␤» 

infix ∈

only sub infix:<>($a$b --> Bool)

Membership operator (alternate).

Equivalent to (elem), at codepoint U+2208 (ELEMENT OF).

infix ∉

only sub infix:<>($a$b --> Bool)

Non-membership operator.

Equivalent to !(elem), i.e., returns True if $a is not an element of $b, at codepoint U+2209 (NOT AN ELEMENT OF).

say 2 !(elem) (123).Set;             # OUTPUT: «False␤» 
say 4 !(elem) (123).Set;             # OUTPUT: «True␤»