Created
January 18, 2013 15:18
-
-
Save michaeldfallen/4565244 to your computer and use it in GitHub Desktop.
Booleans, the way Borat would like them
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 BoratBoolean(b: Boolean) { | |
lazy val not = !b | |
def naaat() = not | |
//Lazy eval, to wait as long as possible before the NAAT | |
} | |
implicit def kazakhstaniBoolean(b: Boolean) = new BoratBoolean(b) | |
usage: | |
val bool = true | |
= Boolean: true | |
bool.not | |
= Boolean: false | |
or | |
bool.naaat | |
= Boolean: false |
willh
commented
Jan 18, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment