[swift-evolution] [Review] SE-0018 Flexible Memberwise Initialization

Matthew Johnson matthew at anandabits.com
Thu Jan 7 17:13:58 CST 2016


> On Jan 7, 2016, at 3:34 PM, Kevin Ballard via swift-evolution <swift-evolution at swift.org> wrote:
> 
> On Thu, Jan 7, 2016, at 11:23 AM, Alex Johnson via swift-evolution wrote:
>> Meanwhile, back on the topic of the "..." placeholder.
>>  
>> For me, it boils down to:
>> The addition of the "memberwise" keyword and associated behavior would stand on it's own, without the inclusion of the "..." placeholder syntax. (IMO)
>> Omitting the "..." placeholder syntax now wouldn't prevent it from being added later.
>> If you agree with those statements, then the principle of "smallest, incremental change <https://swift.org/contributing/#incremental-development>" [swift.org <http://swift.org/>] seems to imply that the placeholder should be removed from this proposal.
>>  
>> That's my opinion. Does the rest of the community feel that the "..." placeholder is a necessary part of this proposal?
>  
> Yes, I feel that the "..." placeholder is necessary. I cannot support a proposal that results in
>  
> memberwise init() {}
>  
> because that initializer very clearly takes no arguments! The "..." serves as a visual indicator for where the arguments go and I think that's important.

I agree.  As soon as the idea of a placeholder was mentioned I immediately liked it.  It is much more clear that additional parameters are synthesized.

>  
> Also, and though this isn't explicitly spelled out in the proposal it seems like a reasonable assumption to make, the existence of "..." lets me put it somewhere other than at the end of the arguments list, e.g.
>  
> memberwise init(..., foo: String) {}

Yes, you will be able to do this.  I didn’t provide and example of this but it is spelled out in the detail design.

>  
> -Kevin Ballard
> 
> _______________________________________________
> 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/20160107/2dc1d62f/attachment.html>


More information about the swift-evolution mailing list