Skip to content

Commit

Permalink
Give set()/bag()/mix() single arg semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Aug 28, 2015
1 parent fc8ab7e commit 18261c9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/core/set_operators.pm
Expand Up @@ -312,8 +312,16 @@ only sub infix:<≽>($a, $b --> Bool) {
$a (>+) $b;
}

sub set(*@args --> Set) { Set.new(@args) }
sub bag(*@args --> Bag) { Bag.new(@args) }
sub mix(*@args --> Mix) { Mix.new(@args) }
proto sub set(|) { * }
multi sub set(\value --> Set) { Set.new(value) }
multi sub set(**@args --> Set) { Set.new(@args) }

proto sub bag(|) { * }
multi sub bag(\value --> Bag) { Bag.new(value) }
multi sub bag(**@args --> Bag) { Bag.new(@args) }

proto sub mix(|) { * }
multi sub mix(\value --> Mix) { Mix.new(value) }
multi sub mix(**@args --> Mix) { Mix.new(@args) }

# vim: ft=perl6 expandtab sw=4

0 comments on commit 18261c9

Please sign in to comment.