Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kolin Modifiers

Kolin Modifiers

「KotlinのLT会!Kotlin入門者の集い」で発表したやつの全部込み版です。

kissybnts

June 26, 2017
Tweet

More Decks by kissybnts

Other Decks in Programming

Transcript

  1. abstract class Invokable { fun invoke(arg: String): String { val

    before = doSomethingBefore(arg) val injected = injectedFunction(before) return doSomethingAfter(injected) } abstract fun injectedFunction(arg: String): String fun doSomethingBefore(arg: String) = "before$arg" fun doSomethingAfter(arg: String) = "${arg}after" }
  2. abstract class Invokable { fun invoke(arg: String): String { val

    before = doSomethingBefore(arg) val injected = injectedFunction(before) return doSomethingAfter(injected) } abstract fun injectedFunction(arg: String): String fun doSomethingBefore(arg: String) = "before$arg" fun doSomethingAfter(arg: String) = "${arg}after" } injectedFunction()ͱ͍͏abstractϝιου
  3. abstract class Invokable { fun invoke(arg: String): String { val

    before = doSomethingBefore(arg) val injected = injectedFunction(before) return doSomethingAfter(injected) } abstract fun injectedFunction(arg: String): String fun doSomethingBefore(arg: String) = "before$arg" fun doSomethingAfter(arg: String) = "${arg}after" } invoke()ͱ͍͏ϝιουͷதͰ
  4. abstract class Invokable { fun invoke(arg: String): String { val

    before = doSomethingBefore(arg) val injected = injectedFunction(before) return doSomethingAfter(injected) } abstract fun injectedFunction(arg: String): String fun doSomethingBefore(arg: String) = "before$arg" fun doSomethingAfter(arg: String) = "${arg}after" } ࢖͏