[swift-evolution] [Proposal draft] Remove objc requirement for optional protocol methods/properties
David Scrève
david.screve at dlta-studio.com
Mon Jan 11 14:42:51 CST 2016
> Le 11 janv. 2016 à 21:39, Douglas Gregor <dgregor at apple.com> a écrit :
>
>
>> On Jan 11, 2016, at 12:24 PM, David Scrève <david.screve at dlta-studio.com <mailto:david.screve at dlta-studio.com>> wrote:
>>
>>
>>
>>> Le 11 janv. 2016 à 18:20, Douglas Gregor <dgregor at apple.com <mailto:dgregor at apple.com>> a écrit :
>>>
>>>>
>>>> var loadPerson:(() -> Person)? {
>>>> return { return Person(name: "Scrève", surname: "David")}
>>>> }
>>>> }
>>>>
>>>> Double returns is quite complex to write and understand..but I agree this problem can be solved like this.
>>>
>>> Right. One could extend the language with a rule that allows a method to satisfy a read-only property requirement when that property is of (possibly optional) function type.
>> Yes, this could be a really good solution…Should I post a proposal for that ?
>
> If you want to tackle the larger proposal of “remove optional requirements” and the various pieces required to make that happen, sure. One issue I haven’t thought about much is how to deal with the argument labels when performing this transformation, because we cannot overload properties. For example, importing UITableViewDataSource would end up with several dozen things named “tableview” :)
Hum…not sure to have enough experience with Swift right now…But I’ll think about it :-)
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160111/3a5121b7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4233 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160111/3a5121b7/attachment.p7s>
More information about the swift-evolution
mailing list