[swift-evolution] [Returned for revision] SE-0161: Smart KeyPaths: Better Key-Value Coding for Swift

Michael LeHew lehewjr at apple.com
Thu Apr 6 20:54:32 CDT 2017


Yes, it is a hypothetical short head, not part of this proposal or any existing proposal currently. But it kind of fits.

-Michael 

> On Apr 6, 2017, at 6:21 PM, Ricardo Parada <rparada at mac.com> wrote:
> 
> Hi,
> 
> I am trying to follow the emails.  Would that be same as KeyPath<Vector,Int> ? Or what is that shorthand?
> 
> Thanks
> Ricardo
> 
> 
>> On Apr 6, 2017, at 8:32 PM, Michael J LeHew Jr via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> \Vector -> Int seems like a more appropriate spelling there no?   The : is usually for is-a/conforms-to relationships, no?
>> 
>> And I agree that such a thing could be considered later and would make the world a better place.
>> 
>> -Michael
>> 
>>>> On Apr 6, 2017, at 4:21 PM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>>>> 
>>>> On Apr 6, 2017, at 2:39 PM, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
>>>> 
>>>> for key in [\Vector.x, \.y, \.z, \.w] {
>>>> 	a[key] += b[key]
>>>> }
>>> 
>>> Sorry to derail slightly, but I'd love to see a key path type shorthand—perhaps something like:
>>> 
>>> 	for key: \Vector: Int in [\.x, \.y, \.z, \.w] {
>>> 		…
>>> 	}
>>> 
>>> It's probably something we should defer until we know more about how frequently people use key paths, though.
>>> 
>>> -- 
>>> Brent Royal-Gordon
>>> Architechies
>>> 
>>> _______________________________________________
>>> swift-evolution mailing list
>>> swift-evolution at swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-evolution
>> 
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170406/06c6090a/attachment.html>


More information about the swift-evolution mailing list