bdawg.io
08/03/2018, 9:16 PMinline fun <T> T.scope(block: T.() -> Unit) {
    block()
}unitscopebdawg.io
08/03/2018, 9:49 PMclass MyKtorService : (Application) -> Unit {
    override fun invoke(app: Application) = app.unit {
        authentication { ... }
        routing { ... }
    }
}
fun main(args: Array<out String>) {
    embeddedServer(Netty, module = dagger.myKtorService()).start(wait = true)
}bdawg.io
08/03/2018, 9:49 PMUnitoverride fun invoke(app: Application) {
    app.run {
        authentication { ... }
        routing { ... }
    }
}bdawg.io
08/03/2018, 10:34 PMT.scopeval list = listOf("one", "two", "three")
list.scope {
    forEach {
        println("item: $it")
    }
    map(String::capitalize).forEach(::println)
    ...
}