> On 6 mars 2017, at 15:53, John McCall via swift-evolution > <[email protected]> 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: https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170220/032582.html <https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170220/032582.html> 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. -- Michel Fortin https://michelf.ca
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
