[swift-evolution] [Review] SE-0030 Property Behaviors
Thorsten Seitz
tseitz42 at icloud.com
Mon Feb 22 09:51:26 CST 2016
Am 19.02.2016 um 21:34 schrieb Brent Royal-Gordon <brent at architechies.com>:
>> I'm having trouble wrapping my head around the difference between accessors and methods defined by a property: AFAIU accessors are like abstract methods if required and just like methods if not, whereas methods are like final methods as they cannot be overridden in a property use site.
>
> Accessors are more like property requirements: they're meant to be customization points, but you can provide a default implementation. Methods defined in a property are for (a) code organization and (b) eventually, exposing additional functionality related to the property to users. No customization allowed.
>
>> If I did understand this correctly then I'd prefer that instead of "accessor" we would just use "func" and introduce a new keyword "abstract". The latter can then be extended to classes in another proposal.
>
> I don't think "abstract" is the right keyword to use, but I do agree that "accessor" might not be the perfect term for this feature. Not sure what would be better, though.
Why? "abstract" is quite common for denoting a method requirement, so I think it is quite appropriate here.
-Thorsten
>
> --
> Brent Royal-Gordon
> Architechies
>
More information about the swift-evolution
mailing list