[swift-evolution] Smart KeyPaths
Ricardo Parada
rparada at mac.com
Sun Mar 19 16:11:09 CDT 2017
Sent from my iPhone
> On Mar 19, 2017, at 4:53 PM, Matthew Johnson via swift-evolution <swift-evolution at swift.org> wrote:
>
>
>
> Sent from my iPhone
>
>> On Mar 19, 2017, at 3:45 PM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>>
>>>> On Mar 19, 2017, at 12:57 PM, Charles Srstka via swift-evolution <swift-evolution at swift.org> wrote:
>>>>
>>>> I disagree. How the reader is supposed to now there is a static property or not ? Having readable code is more important than having easy to write code.
>>>
>>> I’ve got to agree with this. With the proposed syntax, it’s unclear whether you’re referring to a static property or a key path. It’s going to cause confusion. There needs to be some kind of syntactic way to differentiate the two.
>>
>> How often do you have a property with the exact same name and type on both the instance and type? When you *do* have one, how often would it be better off with a name like `defaultFoo` instead of plain `foo`?
>>
That crossed my mind too. If we have a static property with the same name as a property then make it a warning and we can easily rename one or the other in our code to fix the warning.
>> Why is this a problem for keypaths, but not for unbound methods?
>>
Hi Brent, what is an unbound method? Do you have a simple example just so that I can better follow what you are saying? Thanks.
>> How is this different from a hundred other places in Swift where we allow overloading and tolerate ambiguity in order to enjoy nicer syntax?
>>
>> When, in practice, do you expect this to cause trouble?
>
> +1
>
>>
>> --
>> 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/20170319/d62dc06a/attachment.html>
More information about the swift-evolution
mailing list