<div dir="ltr">When you say you missed all the discussions and threads... you missed probably the longest bikeshedding discussion we've had on Swift Evolution so far.<div>First: no-one's ruled out a 'protected' access level yet. Equally, as far as I recall, it hasn't been presented for review yet. It's neither accepted nor rejected. How its type-based access nature works with Swift's scope-based access system will be an interesting topic. Perhaps now's a good time to start it.</div><div>Second: however ugly you find 'fileprivate', you understood what it meant. Not knowing which of 'local' and 'private' was implicitly more private drove a lot of that discussion; that's why 'fileprivate' won. It's also a relative term - for example, since it would be pointless to declare a protocol as 'local' in your hierarchy (since it would then be impossible for another type to conform to it), the protocol would be declared as 'private' but would have 'fileprivate' visibility, which means you wouldn't see 'fileprivate' perhaps as often as you're concerned about.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 8, 2016 at 9:13 PM, Vanderlei Martinelli via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello.<div><br><div><br></div><div>I had a health problem and recently I needed a surgery because of it. Now I'm fine (yay!), but I missed all the discussions and threads at this time.<br></div><div><br></div><div>Reading the SE-0025 proposal, which I find quite valid, I found it the (ugly) keyword `fileprivate` and the lack of a `protected` scope. I know it should be late for you to turn back, but below is my suggestion about the access level scopes the Swift language could implement:</div><div><br></div><div><br></div><div><b>public</b></div><div>Nothing to change. Symbols will be visible to the CONTAINING TYPE and ALL MODULES.</div><div><br></div><div><b>protected *</b></div><div>Symbols visibility will be limited to the CONTAINING TYPE and DERIVED TYPES from the containing type. (Rookies calling `myView.layoutSubviews()` no more...)</div><div><br></div><div><b>internal</b></div><div>Nothing to change. Symbols will be visible to the CONTAINING TYPE and the CURRENT MODULE.</div><div><br></div><div><b>protected internal </b><b>*</b></div><div>Symbols visibility will be limited to the CONTAINING TYPE and DERIVED TYPES from the containing type or the CURRENT MODULE. (They will be `protected` when used by other modules, but `internal` when used by the current module.)<b><br></b></div><div><br></div><div><b>private</b></div><div>The symbols will be visible within the CONTAINING TYPE and the OTHER TYPES in the SAME FILE. (This is the `fileprivate` proposed in SE-0025.)</div><div><br></div><div><b>local </b><b>*</b></div><div>The symbols will be visible within the CONTAINING TYPE ONLY. (No other types accessing my variables anymore... This is the proposed `private`in SE-0025)</div><div><br></div><div><br></div><div><i>The items marked with * denote new access levels. The other remain as they are implemented in Swift 2.x</i><br></div><div><br></div><div><br></div><div>Well... That was it.<br></div><div><br></div><div><br></div><div>Regards,</div><div><br></div><div>Vanderlei Martinelli</div><div><br></div></div></div>
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>