[swift-evolution] Should we rename "class" when referring to protocol conformance?

Matthew Johnson matthew at anandabits.com
Sun May 22 23:06:09 CDT 2016


> On May 22, 2016, at 3:42 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> on Sun May 22 2016, Matthew Johnson <swift-evolution at swift.org> wrote:
> 
>> What I am arguing for is the ability to distinguish aggregates which
>> are logically isolated from aggregates which contain salient
>> references to shared mutable state. 
> 
> Everything with value semantics is logically isolated in that way.

Array<UIView> has salient references whose referent is shared mutable state.  The references are salient attributes. You’re saying the referent doesn’t matter because the boundary of the value stops at the reference.  I’m saying it does matter in that it means the aggregate is no longer logically isolated because shared mutable state is reachable through the aggregate.  Therefore it is not isolated in that way that I was intending to describe.  

> 
>> To be honest, I am really struggling to understand why this
>> distinction seems unimportant to you.
> 
> The non-exposure of shared mutable state is a hugely important property
> of well-encapsulated design.  However, I don't believe it's appropriate
> to represent that with a protocol, because I don't believe there exist
> any generic components whose correctness depends on it.

Do you believe it is appropriate to represent this in some other way that allows us to state architectural intent and introduce constraints for the purpose of structuring a large code base?

> 
> -- 
> -Dave
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list