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

Matthew Johnson matthew at anandabits.com
Mon Feb 13 10:23:05 CST 2017


> On Feb 13, 2017, at 10:19 AM, Karl Wagner <razielim at gmail.com> wrote:
> 
>> 
>>> 
>>> 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”?
> 

Final has a very different meaning: this type has no subtypes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170213/39182ea3/attachment.html>


More information about the swift-evolution mailing list