[swift-evolution] Better syntax for deferred?

Michel Fortin michel.fortin at michelf.ca
Sat Jan 2 12:45:49 CST 2016


Le 2 janv. 2016 à 13:29, Maury Markowitz via swift-evolution <swift-evolution at swift.org> a écrit :

> No, they don't. With the exception of "Go", I'm unfamiliar with any other language that implements this feature *in this fashion*.

D has `scope (exit)`, which is exactly the same as `defer` in Swift.

It's also common to see C++ code using scope guards (implemented as a library feature). As far as I'm aware, this is where the pattern emerged first.

-- 
Michel Fortin
https://michelf.ca



More information about the swift-evolution mailing list