[swift-evolution] RFC: didset and willset

Chris Lattner clattner at apple.com
Fri May 20 01:12:35 CDT 2016


> On May 18, 2016, at 2:01 PM, Matthew Johnson via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On May 18, 2016, at 3:53 PM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>>> didSet and willSet remain outliers in the general rule of conjoined lowercase keywords. Is there any support for bringing these outliers into the fold?
>> 
>> I don't think we shouldn't touch these until we know what accessors on property behaviors are going to look like. We could very well change these now and then change them back in the next version; that kind of bouncing back and forth is maddening for users. Better leave them alone for now and change them later if we decide to, than change them in Swift 3 and then have a high probability of changing them back in Swift 4.
> 
> I generally agree, but is that an option?  Changing `didSet` to `didset` is a breaking change.

In practice, we can accept both spellings for a long time at no harm to anyone.  The first question to answer is “what is the right thing”.  We can talk about how to phase it in separately.

-Chris


More information about the swift-evolution mailing list