Skip to content

Commit

Permalink
force xx op to numify rhs except Whatevers
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Lenz <moritz@faui2k3.org>
  • Loading branch information
Fitz Elliott authored and moritz committed Jul 26, 2010
1 parent b46a3b3 commit 807748a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/core/operators.pm
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,17 @@ our multi infix:<ge>($a, $b) {
}

# XXX Lazy version would be nice in the future too.
class Whatever { ... }

our multi infix:<xx>(Mu \$item, Whatever) {
(1..*).map( { $item } )
}

our multi infix:<xx>(Mu \$item, $n) {
(1..$n).map( { $item } )
(1..+$n).map( { $item } )
}


our multi prefix:<|>(@a) { @a.Capture }
our multi prefix:<|>(%h) { %h.Capture }
our multi prefix:<|>(Capture $c) { $c }
Expand Down Expand Up @@ -326,8 +333,6 @@ our multi sub item($item) {
$item
}

class Whatever { ... }

our multi sub infix:<...>(Code $lhs, $rhs) {
my $limit;
$limit = $rhs if !($rhs ~~ Whatever);
Expand Down

0 comments on commit 807748a

Please sign in to comment.