[swift-evolution] [Pitch] consistent public access modifiers

Karl Wagner razielim at gmail.com
Mon Feb 13 10:19:56 CST 2017


> 
>> 
>> As I mentioned earlier, I don't think `closed` is a good keyword standing alone. And I also think that, given that we have `open`, `closed` also won't pair well with `public`—they sound like antonyms when they aren’t.
> 
> The semantics I am proposing do have an inverse relationship.  That said, it may not be an intuitive or immediately obvious inverse.  I am certainly not wedded to the idea of using `closed` as the keyword.
> 
>> 
>> What I instead suggest is that we think of a closed enum as being like a fragile (non-resilient) struct. In both cases, you are committing to a particular design for the type. So I think we should give them both the same keyword—something like:
>> 
>> 	@fixed struct Person {
>> 		var name: String
>> 		var birthDate: Date
>> 	}
>> 	@fixed enum Edge {
>> 		case start
>> 		case end
>> 	}
>> 
> 

What about “final”?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170213/1a885314/attachment.html>


More information about the swift-evolution mailing list