[swift-evolution] [Draft] A Consistent Foundation For Access Control: Scope-Bounded Capabilities

Matthew Johnson matthew at anandabits.com
Fri Mar 3 13:28:01 CST 2017


> On Mar 3, 2017, at 1:12 PM, Adrian Zubarev <adrian.zubarev at devandartist.com> wrote:
> 
> If I understand the model correctly, then classes structs and enums will have an addition capability for their members.
> 
> static = access(type) access(override, nowhere)
> 
> class = access(type) access(override, everywhere)
> 
> You could combine type into one parameterized access, and make the capability instance the default one, so it will be either or but we don’t have to write instance explicitly like we don’t need it with get.
> 

This isn’t going to work.  The model I am proposing only bounds capabilities.  It doesn’t distinguish between type and instance members.  We definitely need a way to do that and it definitely falls outside the scope of access control.
> 
> 
> 
> -- 
> Adrian Zubarev
> Sent with Airmail
> 
> Am 3. März 2017 um 19:36:31, Adrian Zubarev (adrian.zubarev at devandartist.com <mailto:adrian.zubarev at devandartist.com>) schrieb:
> 
>> I actually found the source, and it’s even an official one. :)
>> 
>> https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/doc/uid/TP40014097-CH34-ID483 <https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Declarations.html#//apple_ref/doc/uid/TP40014097-CH34-ID483>
>> NOTE
>> 
>> In a class declaration, the static keyword has the same effect as marking the declaration with both the class and final declaration modifiers.
>> It’s overlapping but you might be able to adjust the behavior to cover that in your model as well ;)
>> 
>> 
>> 
>> -- 
>> Adrian Zubarev
>> Sent with Airmail
>> 
>> Am 3. März 2017 um 18:14:42, Matthew Johnson (matthew at anandabits.com <mailto:matthew at anandabits.com>) schrieb:
>> 
>>> It would be really helpful if you can find a reference to this somewhere.  If it’s possible to define static in terms of this system also that would be pretty cool.
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170303/b5b6bdf1/attachment.html>


More information about the swift-evolution mailing list