Permalink
Browse files

Implement infix:<%%>, run tests

  • Loading branch information...
tadzik committed Jul 10, 2011
1 parent e42b089 commit f83f8ce1fd719f6748850fc582509f85691d5331
Showing with 6 additions and 4 deletions.
  1. +0 −3 LHF.markdown
  2. +5 −0 src/core/Numeric.pm
  3. +1 −1 t/spectest.data
View
@@ -11,9 +11,6 @@ new possible performance.
## chomp
Fix Str.chomp to work with strings of less than 2 characters.
-## Implement %% operator
-Make S03-operators/is-divisible-by.t pass
-
## Implement minmax operator
Make S03-operators/minmax.t pass
View
@@ -93,6 +93,11 @@ multi infix:<%>() { fail "No zero-arg meaning for infix:<%>" }
multi infix:<%>($x) { $x }
multi infix:<%>(\$a, \$b) { $a.Numeric % $b.Numeric }
+proto infix:<%%>(|$) { * }
+multi infix:<%%>() { fail "No zero-arg meaning for infix:<%%>" }
+multi infix:<%%>($x) { Bool::True }
+multi infix:<%%>(\$a, \$b) { $a.Numeric % $b.Numeric == 0 }
+
proto infix:<lcm>(|$) { * }
multi infix:<lcm>(Int $x = 1) { $x }
multi infix:<lcm>(\$a, \$b) { $a.Numeric lcm $b.Numeric }
View
@@ -134,7 +134,7 @@ S03-operators/eqv.t
# S03-operators/identity.t # need array element binding
S03-operators/increment.t
# S03-operators/inplace.t # err: too many positional arguments: 3 passed, 1 expected
-# S03-operators/is-divisible-by.t # err: Could not find sub &infix:<%%>
+S03-operators/is-divisible-by.t
S03-operators/list-quote-junction.t
# S03-operators/minmax.t # err: Could not find sub &infix:<minmax>
# S03-operators/misc.t # need regexes

0 comments on commit f83f8ce

Please sign in to comment.