Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $a = (1, 2, 3).Set;
- my $b = (2, 4).Set;
- # Union.
- $a (|) $b ~~ (1, 2, 3, 4).Set or die "Wrong status";
- # Intersection.
- $a (&) $b ~~ (2).Set or die "Wrong status";
- # Difference.
- $a (-) $b ~~ (1, 3).Set or die "Wrong status";
- # Symmetric difference.
- $a (^) $b ~~ (1, 3, 4).Set or die "Wrong status";
- my $c = (2, 3).Set;
- # Superset.
- $a (>=) $c or die "Wrong status";
- # Strict superset.
- $a (>) $c or die "Wrong status";
- # Subset.
- $c (<) $a or die "Wrong status";
- # Strict subset.
- $c (<=) $a or die "Wrong status";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement