[swift-evolution] access control proposal
John McCall
rjmccall at apple.com
Wed Dec 9 12:07:27 CST 2015
> On Dec 9, 2015, at 9:57 AM, Matthew Johnson <matthew at anandabits.com> wrote:
>> We should be disallowing access modifiers in function contexts anyway.
>
> I didn't mean people would expect to use the access modifier in a function context, but it is common to refer to member variables as 'public', 'internal' or 'private' variables and it is common to refer to variables scoped to a function as local variables. There has never been any potential for confusion because there has never been a language I know of with a 'local' access modifier.
>
> If we add one using this keyword I could imagine confusion between members declared with the 'local' access modifier and variables scoped to a function. The potential for confusion would be most prevalent in new developers, but I can also imagine casual conversations between experienced developers where such confusion might arise. It's something to consider when thinking about whether or not this would be the best keyword to use.
That’s a very good point.
John.
More information about the swift-evolution
mailing list