Circling back to `with`

We could steal an idea from Kotlin and let you bind self in the scope of a closure:

let dateFormatter = with(DateFormatter()) { self in
    dateStyle = .short
    timeStyle = .long
}

which seems like a reasonable extension of the much-demanded guard let self = self rebinding idea.

11 Likes