Created
June 30, 2020 04:18
-
-
Save humanscape-david/8d048f2a0eec63ff49e1de31a7447d99 to your computer and use it in GitHub Desktop.
코틀린 합성함수 예시
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
| fun main(args: Array<String>) { | |
| println(composed(3)) // 9 출력 | |
| } | |
| fun composed(i: Int) = addThree(twice(i)) | |
| fun addThree(i: Int) = i + 3 | |
| fun twice(i: Int) = i * 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment