Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

force xx op to numify rhs except Whatevers

Signed-off-by: Moritz Lenz <moritz@faui2k3.org>
  • Loading branch information...
commit 807748a2ea5235f1440bc73de0011e6aecfba491 1 parent b46a3b3
@felliott felliott authored moritz committed
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/core/operators.pm
View
11 src/core/operators.pm
@@ -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 }
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.