[swift-evolution] [Manifesto] Ownership
michel.fortin at michelf.ca
Mon Mar 6 15:48:29 CST 2017
> On 6 mars 2017, at 15:53, John McCall via swift-evolution <swift-evolution at swift.org> wrote:
> Class types have reference semantics and are still copyable; ownership is not going to change that. More generally, I don't see how anything we can do in ownership could ever do something like eliminate the possibility of a reference-semantics collection from the language.
I'll just drop a note to say that I explained how we could implement provable value-type semantics in the discussion about "pure" a few weeks ago. This was the overview:
The part that might have some relation to ownership is the notion in the type system that a pointer is guarantied to be uniquely referenced. You can check for that at runtime with `isUniquelyReferenced`, but that information is lost as soon as the call returns. If there was a way to safely flag a variable as a "unique reference" and for the compiler to detect when the uniqueness might be broken, then it'd open the door to the compiler being able to enforce value-type semantics.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution