Last active
August 29, 2015 14:04
-
-
Save jelmerk/5f64bc86e1f09a16771b 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 BooleanWrapper(var value:Boolean) { | |
def ===(check:Boolean) = check == value | |
def stop() = value = !value | |
} | |
class Person(isSad: BooleanWrapper = new BooleanWrapper(true)) { | |
def sad() = isSad | |
def beAwesome() { } | |
} | |
val person = new Person() | |
import person._ | |
if (sad() === true) { | |
sad().stop(); | |
beAwesome(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment