Advertisement
Guest User

Untitled

a guest
Jun 11th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.21 KB | None | 0 0
  1.     def construct(that: Point, op: (Int, Int) => Int) =
  2.         Point(op(this.x, that.x), op(this.y, that.y))
  3.     def + (that: Point) : Point = construct(that, _ + _)
  4.     def - (that: Point) : Point = construct(that, _ - _)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement