[swift-evolution] access control proposal
matthew at anandabits.com
Wed Dec 9 11:16:44 CST 2015
> I’m still not completely convinced about the need for this level of access control, but I really like “local” as the keyword for it.
I don't think we *need* it, but it does allow for more explicit statement of intent in code and enforcement of that intention by the compiler. That is almost always a good thing IMO as long as it doesn't make your code excessively verbose. In this case we would be replacing 'private' with 'local' so no verbosity would be added.
I don't think it's a really high priority addition relative to a lot of other things, but it seems to me like a relatively low cost feature with few if any downsides. Programmers who don't want to use it don't have to. I wonder if there are any strong arguments against adding it other than it making the language ever so slightly larger.
The 'local' keyword does seem pretty good. I like it much better than 'classified'. My only question about it is whether some programmers might confuse it with local variables in a function.
More information about the swift-evolution