Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
CHEAT: Directly implement Whatever versions of the most common &infix…
…:<+> and &infix:<-> operations, so that we have them available even though the full Whatever closure code is not done.
  • Loading branch information
colomon committed Mar 11, 2010
1 parent 595ec0e commit eac348a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/core/operators.pm
Expand Up @@ -415,3 +415,23 @@ our multi sub infix:<Z>(Iterable $a-iterable, Iterable $b-iterable) {
multi sub infix_prefix_meta_operator:<!>($a, $b, $c) {
!(pir::get_hll_global__CS($a)($b, $c));
}

# CHEAT: These should be automatically generated by the grammar,
# I think. But this is a quick fix to get some basic functionality
# working.

multi sub infix:<+>(Whatever, $rhs) {
-> $a { $a + $rhs; };
}

multi sub infix:<+>($lhs, Whatever) {
-> $a { $lhs + $a; };
}

multi sub infix:<+>(Whatever, Whatever) {
-> $a, $b { $a + $b; };
}

multi sub infix:<->(Whatever, $rhs) {
-> $a { $a - $rhs; };
}

0 comments on commit eac348a

Please sign in to comment.