Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement infix:<X>.
  • Loading branch information
colomon committed Mar 15, 2010
1 parent e3b5d7b commit bc08aa4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Perl6/Grammar.pm
Expand Up @@ -1250,6 +1250,7 @@ token prefix:sym<not> { <sym> >> <O('%loose_unary')> }
token infix:sym<,> { <sym> <O('%comma')> }

token infix:sym<Z> { <sym> <O('%list_infix')> }
token infix:sym<X> { <sym> <O('%list_infix')> }

token infix:sym<...> { <sym> <O('%list_infix')> }
# token term:sym<...> { <sym> <args>? <O(|%list_prefix)> }
Expand Down
12 changes: 12 additions & 0 deletions src/core/operators.pm
Expand Up @@ -412,6 +412,18 @@ our multi sub infix:<Z>(Iterable $a-iterable, Iterable $b-iterable) {
}
}

our multi sub infix:<X>(Iterable $a-iterable, Iterable $b-iterable) {
my $ai = $a-iterable.iterator;
my @b = $b-iterable.Seq;
gather loop {
my $a = $ai.get;
last if ($a ~~ EMPTY);
for @b -> $b {
take ($a, $b);
}
}
}

# Eliminate use of this one, but keep the pir around for
# the moment, as it may come in handy elsewhere.
#
Expand Down

0 comments on commit bc08aa4

Please sign in to comment.