> On Mar 15, 2016, at 3:09 PM, Shawn Erickson <[email protected]> wrote:
> 
> 
> 
> On Tue, Mar 15, 2016 at 2:05 PM Erica Sadun <[email protected] 
> <mailto:[email protected]>> wrote:
> I see two results on the gmane search and neither one seems to match what 
> you're talking about:
> http://search.gmane.org/?query=Scoped&author=Shawn&group=gmane.comp.lang.swift.evolution&sort=relevance
>  
> <http://search.gmane.org/?query=Scoped&author=Shawn&group=gmane.comp.lang.swift.evolution&sort=relevance>
> 
> Do you have a direct link to the message I should be reading?
> 
> Thanks!
> 
> [swift-evolution] SE-0025: Scoped Access Level, next steps 
> <https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160314/012640.html>
>  


The state of the art is:
public private(set) var foo = 0
If I'm reading and understanding this correctly, you propose a generally 
postfix solution like this:
public var foo = 0 {  // marks default getter and setter public however...
  private set         // marks default setter private
}
Unless there's a specific getter or setter implementation, I'm not fond of the
postfix declarations. In my opinion `private set` is modifying `public`, not 
`var foo = 0`

I recognize that in a type rather than a global variable, the modification
override could not be adjacent. Another comparison. Current art:
public struct bar {
    private(set) var gar = 0
}
vs (what I think is) your suggestion:
public struct bar {
    var gar = 0 {
        private set
    }
}
And again, moving the access control modification to the end just doesn't look 
right to me or seem to enhance readability. :(

-- E

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to