> After all, it's absurd that a closure would be supplied as an argument for 
> any purpose other than being done or invoked or performed.

In the calls at hand, like `withUnsafeMutablePointer`, "do" is the verb of the 
call. That is not true of many—perhaps most—closures. For instance, the verb of 
`map(_:)` is "map". The verb of `save(to:for:completionHandler:)` is "save".

On the other hand, in `withUnsafeMutablePointer(_:do:)`, the verb of the call 
really *is* "do". Doing the closure and causing its side effects to occur or 
its return value to be calculated is the entire purpose of that call. In a 
sense, the call is sort of backwards; if it weren't for the fact that closures 
are very long, it might be better written as `do(_:withUnsafeMutablePointer:)`.

(Hmm. *Technically* I suppose that call *ought* to be 
`withUnsafeMutablePointer(to:do:)`...)

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to