Personally, I'm fine with current state of things.

Firstly, I consider classes like a compatibility feature. They slightly
fall out of Swift type system. One can almost entirely avoid them, except
when interacting with ObjC. (They somehow code in Haskell, right?)

Secondly, when we interact with a struct (record), we expect it not to
mutate itself by default.
On the other hand, classes are black boxes, they represent some entity with
which we interact. It is natural for such entities to perform internal
mutation during operation.

> protocols with mutating methods should be constrained to applying to
non-class types
All methods of classes are implicitly mutating, so if something, then
protocols with non-mutating methods should be disallowed for classes.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to