Re:Manifesto: Adding memory ownership to Swift
by jsolson on Saturday February 18, 2017 @11:17AM
(#13675246)
This is fair, and what I've done so far in Swift (with a cute little extension on NSLocking no less :).
If you're going to add moveonly types with destructors, though, it seems strongly desirable to give them (or at least making available) lexical RAII semantics.
Something like
Where lock_guard() might be then something like this, implemented on some utility library: This is one of the RAII approaches in functional programming, using partial function application and higher order functions, to create new types of operations.