Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add prefix:<+^>(Any), winning us the S03-operators/bit.t tests.
  • Loading branch information
pmichaud committed Aug 3, 2011
1 parent 0db8c6f commit a207490
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/core/Numeric.pm
Expand Up @@ -153,27 +153,28 @@ multi infix:«>=»(\$a, \$b) { $a.Numeric >= $b.Numeric }
proto infix:<+&>(|$) { * }
multi infix:<+&>() { +^0 }
multi infix:<+&>($x) { $x }
multi infix:<+&>($x, $y) { $x.Numeric +& $y.Numeric }
multi infix:<+&>($x, $y) { $x.Numeric.Int +& $y.Numeric.Int }

proto infix:<+|>(|$) { * }
multi infix:<+|>() { 0 }
multi infix:<+|>($x) { $x }
multi infix:<+|>($x, $y) { $x.Numeric +| $y.Numeric }
multi infix:<+|>($x, $y) { $x.Numeric.Int +| $y.Numeric.Int }

proto infix:<+^>(|$) { * }
multi infix:<+^>() { 0 }
multi infix:<+^>($x) { $x }
multi infix:<+^>($x, $y) { $x.Numeric +^ $y.Numeric }
multi infix:<+^>($x, $y) { $x.Numeric.Int +^ $y.Numeric.Int }

proto infix:«+<»(|$) { * }
multi infix+<»() { fail "No zero-arg meaning for infix:«+<»"; }
multi infix+<»($x) { $x }
multi infix+<»($x,$y) { $x.Numeric +< $y.Numeric }
multi infix+<»($x,$y) { $x.Numeric.Int +< $y.Numeric.Int }

proto infix:«+>»(|$) { * }
multi infix+>»() { fail "No zero-arg meaning for infix:«+>»"; }
multi infix+>»($x) { $x }
multi infix+>»($x,$y) { $x.Numeric +> $y.Numeric }
multi infix+>»($x,$y) { $x.Numeric.Int +> $y.Numeric.Int }

proto prefix:<+^>(|$) { * }
proto prefix:<+^>(|$) { * }
multi prefix:<+^>($x) { +^ $x.Numeric.Int }

2 changes: 1 addition & 1 deletion t/spectest.data
Expand Up @@ -121,7 +121,7 @@ S03-operators/binding-closure.t
# S03-operators/binding-hashes.t # err: Cannot use bind operator with this LHS
S03-operators/binding-ro.t
S03-operators/binding-scalars.t
# S03-operators/bit.t # err: No applicable candidates found to dispatch to for 'prefix:<+^>'
S03-operators/bit.t
S03-operators/boolean-bitwise.t
S03-operators/brainos.t
# S03-operators/buf.t # err: Method 'encode' not found for invocant of class 'Str'
Expand Down

0 comments on commit a207490

Please sign in to comment.