Skip to content

Instantly share code, notes, and snippets.

@michaeldfallen
Created January 18, 2013 15:18
Show Gist options
  • Save michaeldfallen/4565244 to your computer and use it in GitHub Desktop.
Save michaeldfallen/4565244 to your computer and use it in GitHub Desktop.
Booleans, the way Borat would like them
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
Copy link

willh commented Jan 18, 2013

suit.colour == grey.naaat
res1: Boolean = true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment