Skip to content

Instantly share code, notes, and snippets.

@lildata
Created June 4, 2015 18:24
Show Gist options
  • Save lildata/6ec31393c6a90c616595 to your computer and use it in GitHub Desktop.
Save lildata/6ec31393c6a90c616595 to your computer and use it in GitHub Desktop.
Prefix (unary_) & Postfix are cool for DSLs
case object CONNECTION {
def unary_! = DISCONNECTION
def REMOVE = DISCONNECTION
}
case object DISCONNECTION
println(!CONNECTION == DISCONNECTION) //true
println((CONNECTION REMOVE) == DISCONNECTION) //true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment