[swift-evolution] Smart KeyPaths
Ricardo Parada
rparada at mac.com
Mon Mar 20 20:52:15 CDT 2017
That is very interesting: "formatting templates that are well typed."
Would that be like a template and keypaths that were archived to a file, similar to a .nib file?
> On Mar 20, 2017, at 7:28 PM, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
>
>
>> On Mar 20, 2017, at 4:01 PM, Kenny Leung via swift-evolution <swift-evolution at swift.org> wrote:
>>
>> Hi All.
>>
>> I’m not sure I’m understanding this proposal properly. In (old) Cocoa, two places where key paths were used extensively was EOF/CoreData, and WebObjects. I’m wondering how Smart KeyPaths will solve these two problems:
>>
>> 1. fetching data from a database and stuff it into objects that are not known at compile time (since you’ve written the framework ahead of time)
>>
>> 2. Token replacing text in a template, like ${person.firstName}
>>
>> Will there be some conversion of key paths to/from strings?
>
> There won't be a conversion from strings in this initial proposal. That would be a reasonable thing to add later. For the use case of formatting strings, hopefully, there'll eventually be some way to build formatting templates that are well-typed instead of relying on parsing strings at runtime.
>
> -Joe
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
More information about the swift-evolution
mailing list