Tagged in

Kotlin

kjcoop
kjcoop
경기광주 개발협동조합
More information
Followers
13
More, on Medium

Dynamic proxy

반복을 단순하게

kotlin 1.3.50, java 1.8 기준으로 작성하였습니다.

Android 의 유명한 라이브러리 retrofit2 는 interface 를 선언하고, 이 interface 를 마치 concrete class 의 method 처럼 사용한다.

interface 는 구현체가 없기 때문에, 구현을 대행해야 하는데 바로 이 때 사용할 수 있는 클래스가…


Kotlin let, also, run, apply, with 분석

Higher-order functions 를 읽으면 도움이 됩니다.

Standard.kt 에는 유용한 함수들이 있는데 그 중 자주 사용하는 함수는 let, also, run, apply, with 등을 들 수 있다.


Kotlin Higher-Order Functions

코틀린에서는 아래와 같이 정의하고 있다.

A higher-order function is a function that takes functions as parameters, or returns a function.

함수를 인자로 받거나, 함수를 반환하면 higher-order 함수이다.