[swift-evolution] Smart KeyPaths
jhull at gbis.com
Wed Mar 29 20:21:22 CDT 2017
> On Mar 29, 2017, at 6:08 PM, Matthew Johnson via swift-evolution <swift-evolution at swift.org> wrote:
> The one big loss I see from the original proposal is that the current design does not allow us to create a type context that provides something as concise as the original dot shorthand to create key paths. It's still supported in one sense, but require the #keyPath() wrapper around the key path expression. That's a lot less elegant.
> I would love it if we found a way to retain something as concise as that shorthand. I'm working on a library where users will specify a collection of key paths pairs. This shorthand would be a very nice piece of sugar making the code expressing these collections (usually literals) quite a bit more readable.
+1 for this. I think it will be somewhat common to pass around arrays of these things, and a shorthand syntax of some sort would make that nicer. That said, I don’t want to slow down the proposal, since I will be using this feature the very second it becomes available.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution