Android/Kotlin (1) 썸네일형 리스트형 kotlin(코틀린) apply,run,with,let,also 함수 함수들의 개념 확인용으로 작성 및 다른분의 블로그의 내용을 토대로 작성되었습니다. 5가지 함수의 정의 inline fun with(receiver: T, block: T.() -> R): R { return receiver.block() } inline fun T.also(block: (T) -> Unit): T { block(this) return this } inline fun T.apply(block: T.() -> Unit): T { block() return this } inline fun T.let(block: (T) -> R): R { return block(this) } inline fun T.run(block: T.() -> R): R { return block() } with run과 .. 이전 1 다음