I'm quite happy to finally have more official tools in the language to control memory ownership when necessary. +1
Thanks for that, it clarified a bit how it worked. While reading I felt like I forgot my days using MRC! I'm actually still a bit confused why the +1 of a consuming arg needs to be in the caller and not the callee, probably obvious but I'm not seeing it right now.
In terms of naming I guess consume/nonconsume is getting into people's heads already but for me is more confusing than the own/borrow
words used in Rust. That said in that language things are more clear/explicit so they are also less confusing.
For example, right now using these keywords doesn't change the semantics of our code, since Swift with insert ARC/copies when needed anyway right? It would only matter for semantics once we have move-only types (or the @noImplicitCopy
mentioned in the roadmap) since at that point a consumed argument won't be able to be used in the caller after the call. Corrrect?
From the roadmap:
Would it be useful to specify in the proposal what role inout
plays (if any) in this?