Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make sure Supply.(zip|merge) noop correctly
  • Loading branch information
lizmat committed Apr 21, 2014
1 parent e974894 commit b916084
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/SupplyOperations.pm
Expand Up @@ -358,8 +358,9 @@ my class SupplyOperations is repr('Uninstantiable') {

method merge(*@s) {

@s.shift unless @s[0].defined; # lose if used as class method
return @s[0] if +@s <= 1; # nothing to be done
@s.shift unless @s[0].DEFINITE; # lose if used as class method
return Supply unless +@s; # nothing to be done
return @s[0] if +@s == 1; # nothing to be done

my $dones = 0;
on -> $res {
Expand All @@ -372,8 +373,9 @@ my class SupplyOperations is repr('Uninstantiable') {

method zip(*@s, :&with is copy) {

@s.shift unless @s[0].defined; # lose if used as class method
return Supply unless +@s; # nothing to be done
@s.shift unless @s[0].DEFINITE; # lose if used as class method
return Supply unless +@s; # nothing to be done
return @s[0] if +@s == 1; # nothing to be done

my &infix:<op> = &with // &[,]; # hack for [[&with]] parse failure
my @values = ( [] xx +@s );
Expand Down

0 comments on commit b916084

Please sign in to comment.