Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement infix:<%%>, run tests
  • Loading branch information
Tadeusz Sośnierz committed Jul 10, 2011
1 parent e42b089 commit f83f8ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 0 additions & 3 deletions LHF.markdown
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/core/Numeric.pm
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion t/spectest.data
Expand Up @@ -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
Expand Down

0 comments on commit f83f8ce

Please sign in to comment.