[swift-evolution] private & fileprivate
danielt1263 at gmail.com
Sun Oct 9 12:22:14 CDT 2016
This discussion reminds me of Eiffel’s access system. Instead of having these generic “public/private” distinctions, in Eiffel the programer specifies exactly which methods can be used by which classes. So a “public” method would be defined as accessible to “[Any]” and a private method would be defined as accessible to “[Self]”. If you want to grant access of a particular method to only particular helper classes, you would specify them.
Having a system like that would solve Karl’s problem because it wouldn’t matter what physical file the classes are in.
More information about the swift-evolution