Sample non lambda instantiation
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
fun oldInstantiation() { | |
val defaultParser = object : Parser{ | |
override fun parse(value: String): ParsedOutput { | |
require(value.length > 4) | |
ParsedOutput(value.substring(0, 3), value.substring(3, value.length)) | |
} | |
} | |
} | |
fun newInstantiation() { | |
val defaultParser = Parser { value -> | |
require(value.length > 4) | |
ParsedOutput(value.substring(0, 3), value.substring(3, value.length)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment