Last active
July 10, 2017 05:49
-
-
Save nomisRev/bb197be88cdfe4b9cf0a18a63e9567b5 to your computer and use it in GitHub Desktop.
Modelling data in Kotlin
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
sealed class MathExpression | |
data class Add(val left: MathExpression, val right: MathExpression) : MathExpression() | |
data class Sub(val left: MathExpression, val right: MathExpression) : MathExpression() | |
data class Number(val value: Int): MathExpression() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment