I'd like to define a function `configure` that wou...
# announcements
b
I'd like to define a function
configure
that would take a variable number of arguments and a lambda with an implicit receiver to be useable like this:
Copy code
configure(repositories, project.repositories) {
    jcenter() 
}
The closest I got was this:
Copy code
fun <T: Any> configure(vararg ts: T): (T.() -> Unit) -> Unit =
    { configuration -> for (t in ts) t.configuration() }

configure(repositories, project.repositories)({
    jcenter()
})
Note the
({ ... })
. Is there a better way?