Created
March 11, 2015 04:28
-
-
Save shigemk2/638652ac905db0a8e291 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo(x: Int) { | |
val v = x | |
def +(y: Foo) = new Foo(v + y.v) | |
def less(y: Foo) = v < y.v | |
} | |
val a = new Foo(1) + new Foo(2) | |
val b = new Foo(1) less new Foo(2) | |
println(a.v) // 3 | |
println(b) // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment