Created
June 4, 2015 18:24
-
-
Save lildata/6ec31393c6a90c616595 to your computer and use it in GitHub Desktop.
Prefix (unary_) & Postfix are cool for DSLs
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
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