[swift-evolution] [Review #2] SE-0161: Smart KeyPaths: Better Key-Value Coding for Swift
edwellbrook at gmail.com
Thu Apr 6 08:03:02 CDT 2017
Apologies if I’ve simply just missed something, but are the trailing right parentheses in the proposed solution intentional? Reading through the code, having loosely followed this discussion, I’m really confused.
// create a key path and use it
let firstFriendsNameKeyPath = \Person.friends.name)
// optional properties work too
let bestFriendsNameKeyPath = \Person.bestFriend?.name)
If it’s intentional, I’m very much against it.
> On 6 Apr 2017, at 13:14, Ricardo Parada via swift-evolution <swift-evolution at swift.org> wrote:
>> On Apr 5, 2017, at 11:13 PM, Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
>> It is also worth mentioning that, with the sigil, the `keyPath` label may not be so necessary:
>> // or, if the suggestion above is accepted
> I think the label makes it more obvious, specially when using it with a key path variable:
> let someKeyPath = ...
> keyPath: someKeyPath]
> swift-evolution mailing list
> swift-evolution at swift.org
More information about the swift-evolution