This is my first post on this list so please bear with me.
I very much like this proposal but what bothers me is this doubling of
valueForKeyPath(#keyPath(xxx) in the signature of the function.
chris.valueForKeyPath(#keyPath(Person.bestFriend.lastName)) // => Groff
chris.valueForKeyPath(#keyPath(Person.friends.firstName)) // => ["Joe",
"Douglas"]
I’m not sure whether the form below is actually possible. For me it reads more
naturally and is more consistent with “Modern Swift” as far as I know.
chris.valueFor(#keyPath(Person.friends.firstName)) // => ["Joe", "Douglas”]
or maybe
chris.valueOf(#keyPath(Person.friends.firstName)) // => ["Joe", "Douglas”]
Just my observation.
Regards
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution