Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add infix C«(<=)», infix C«⊆», infix C«⊈» to operators
  • Loading branch information
lizmat committed May 6, 2019
1 parent c4712fd commit 863ebf0
Showing 1 changed file with 36 additions and 25 deletions.
61 changes: 36 additions & 25 deletions doc/Language/operators.pod6
Expand Up @@ -2282,6 +2282,42 @@ C«!(<)».
C«» is codepoint U+2284 (NOT A SUBSET OF).
=head2 infix C«(<=)», infix C«»
multi sub infix:<(<=)>($a,$b --> Bool:D)
multi sub infix:<⊆>($a,$b --> Bool:D)
X<Subset of or equal to operator>.
Returns C<True> if C<$a> is a B<subset> of C<$b>, i.e., that all the
elements of C<$a> are elements of C<$b> but C<$a> is a smaller or equal sized
set than C<$b>.
=begin code
say (1,2,3) (<=) (2,3,1); # OUTPUT: «True␤»
say (2,3) (<=) (2,3,1); # OUTPUT: «True␤»
say 4 ⊆ (1,2,3); # OUTPUT: «False␤»
=end code
C«» is equivalent to C«(<=)», at codepoint U+2286 (SUBSET OF OR EQUAL TO).
=head2 infix C«»
multi sub infix:<⊈>($a,$b --> Bool:D)
X<Not a subset of nor equal to operator>.
Returns C<True> if C<$a> is B<not> a C<subset> of C<$b>. Equivalent to
C«!(<=)».
=begin code
say (1,2,3) ⊄ (2,3,1); # OUTPUT: «True␤»
say (2,3) ⊄ (2,3,1); # OUTPUT: «False␤»
say 4 !(<=) (1,2,3); # OUTPUT: «True␤»
=end code
C«» is codepoint U+2288 (NEITHER A SUBSET OF NOR EQUAL TO).
=head1 Tight AND precedence
=head2 infix C«&&»
Expand Down Expand Up @@ -3226,31 +3262,6 @@ This summary those operators are included for completeness.
=head2 Operators that return C<Bool>
=head3 infix (<=)
X<Subset of or equal to operator>.
Returns C<True> if C<$a> is a B<subset> or B<is equal to> C<$b>.
=head3 infix ⊆
Alternate X<subset of or equal to operator>.
Equivalent to L«(<=)».
=head3 infix !(<=)
X<Neither subset of nor equal to operator>.
Returns C<True> if C<$a> is a B<not a subset> or B<is not equal> to C<$b>.
=head3 infix ⊈
Alternate X<neither subset of nor equal to operator>, at codepoint U+2288
(NEITHER A SUBSET OF NOR EQUAL TO).
Equivalent to C«!(<=)».
=head3 infix (>=)
X<Superset of or equal to operator>.
Expand Down

0 comments on commit 863ebf0

Please sign in to comment.