Skip to content

Instantly share code, notes, and snippets.

@humanscape-david
Created June 30, 2020 04:18
Show Gist options
  • Select an option

  • Save humanscape-david/8d048f2a0eec63ff49e1de31a7447d99 to your computer and use it in GitHub Desktop.

Select an option

Save humanscape-david/8d048f2a0eec63ff49e1de31a7447d99 to your computer and use it in GitHub Desktop.
코틀린 합성함수 예시
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