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

Brent Royal-Gordon brent at architechies.com
Thu Apr 6 18:21:51 CDT 2017


> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170406/e4156612/attachment.html>


More information about the swift-evolution mailing list