Created
April 5, 2019 14:43
-
-
Save cdsap/4ef8b7ecb3dbe808fa6b07b8c7adc9d7 to your computer and use it in GitHub Desktop.
StarWars
This file contains hidden or 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
/* | |
I am your Father Luke | |
*/ | |
sealed class Pronouns { | |
object I : Pronouns() | |
object You : Pronouns() | |
} | |
sealed class PronounsPer { | |
object Your : PronounsPer() | |
object My : PronounsPer() | |
} | |
sealed class Characters { | |
object Luke : Characters() | |
object Leila : Characters() | |
} | |
infix fun Pronouns.I.am(value: PronounsPer) = Wrapper(this) | |
infix fun Pronouns.You.are(value: PronounsPer) = Wrapper(this) | |
class Wrapper(val pronouns: Pronouns) { | |
infix fun Father(characters: Characters) = | |
pronouns == Pronouns.I && characters == Characters.Luke | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment