<html><body><div>+1<br></div><div><br data-mce-bogus="1"></div><div>-Thorsten<br data-mce-bogus="1"></div><div><br>Am 06. Januar 2016 um 21:49 schrieb Alex Johnson via swift-evolution &lt;swift-evolution@swift.org&gt;:<br><br><div><blockquote type="cite"><div class="msg-quote"><div dir="ltr">Hopefully this is still the right place to discuss this proposal (it's <a href="https://github.com/apple/swift-evolution/blob/master/schedule.md" data-mce-href="https://github.com/apple/swift-evolution/blob/master/schedule.md">listed as being in active review</a>, but I don't see a separate [Review] thread).<div><br></div><div>I like this proposal. I think it will bring some much-needed ease-of-use.</div><div><br></div><div>I'm not sold on the "..." placeholder for the memberwise arguments, though. I know this was suggested by Chris Lattner, so I'm tempted to defer to his judgement. But here are my thoughts:</div><div><br></div><div>First, it's very close to the varags syntax (e.g. "Int...") which can also appear in initializer argument lists.</div><div><br></div><div>Second, and I think more important, I'm not sure that it's all that <i>useful</i>. Aside from being used to mark the initializer as having "memberwise" semantics, which is already done by the "memberwise" keyword, the most common example I've seen is code like this:</div><div><br></div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;" data-mce-style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div><span style="font-family: monospace,monospace;" data-mce-style="font-family: monospace,monospace;" face="monospace, monospace">memberwise init(customArg: Int, ...) {</span></div><div><span style="font-family: monospace,monospace;" data-mce-style="font-family: monospace,monospace;" face="monospace, monospace">&nbsp; /* use customArg */</span></div><div><span style="font-family: monospace,monospace;" data-mce-style="font-family: monospace,monospace;" face="monospace, monospace">}</span></div></blockquote><div><br></div><div>That is, it's used to indicate where the synthesized arguments appear in the argument list if there are also custom (non-memberwise) arguments.</div><div><br></div><div>My question is, <b>why not always put the memberwise arguments last?</b>&nbsp;That would eliminate the need for the placeholder (aka "...").</div><div><br></div><div>I don't think I've seen a compelling case for embedding the "..." <i>within</i>&nbsp;a list of custom arguments, like:</div><div><br></div><div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;" data-mce-style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div><span style="font-family: monospace , monospace;" data-mce-style="font-family: monospace , monospace;">memberwise init(customArg1: Int, ..., customArg2: Int) {</span></div><div><span style="font-family: monospace , monospace;" data-mce-style="font-family: monospace , monospace;">&nbsp; /* use customArg1 and customArg2 */</span></div><div><span style="font-family: monospace , monospace;" data-mce-style="font-family: monospace , monospace;">}</span><br></div></blockquote></div><div><br></div><div>And it's been mentioned several times that this is purely additive. If there <i>is</i>&nbsp;an obscure case where that is useful, the author can write use manual initialization.</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 6, 2016 at 6:48 AM, Thorsten Seitz via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" data-mce-href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex; border-left: 1px #ccc solid; padding-left: 1ex;" data-mce-style="margin: 0 0 0 0.8ex; border-left: 1px #ccc solid; padding-left: 1ex;">Ok, that makes sense.<br> <br> -Thorsten<br><div><div><br> &gt; Am 03.01.2016 um 00:24 schrieb Chris Lattner &lt;<a href="mailto:clattner@apple.com" data-mce-href="mailto:clattner@apple.com">clattner@apple.com</a>&gt;:<br> &gt;<br> &gt;<br> &gt;&gt; On Jan 2, 2016, at 2:48 PM, Thorsten Seitz &lt;<a href="mailto:trsfoo@googlemail.com" data-mce-href="mailto:trsfoo@googlemail.com">trsfoo@googlemail.com</a>&gt; wrote:<br> &gt;&gt;<br> &gt;&gt; One question just occurred to me: do we really need the keyword „memberwise“ anymore? Wouldn’t just using "init(…)“ be sufficient?<br> &gt;<br> &gt; It wouldn’t be necessary to make the parser work, but I think we’d want something to make it clear what was intended.&nbsp; Otherwise, you could write:<br> &gt;<br> &gt;&nbsp; &nbsp; init(a : Int, …)<br> &gt;<br> &gt; when you meant:<br> &gt;&nbsp; &nbsp; init(a : Int …)<br> &gt;<br> &gt; and unfortunate things would happen.&nbsp; The memberwise keyword also makes it much more clear to the reader what is going on.<br> &gt;<br> &gt; -Chris<br> _______________________________________________<br> swift-evolution mailing list<br> <a href="mailto:swift-evolution@swift.org" data-mce-href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br> <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" data-mce-href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><br></div><div><div dir="ltr" style="font-size: 12.8000001907349px;" data-mce-style="font-size: 12.8000001907349px;"><b style="font-size: small; background-color: transparent;" data-mce-style="font-size: small; background-color: transparent;"><span style="color: #35d990;" data-mce-style="color: #35d990;"><span style="font-family: arial,helvetica,sans-serif;" data-mce-style="font-family: arial,helvetica,sans-serif;" face="arial, helvetica, sans-serif">Alex Johnson</span></span><span style="color: #666666;" data-mce-style="color: #666666;" color="#666666">&nbsp;| Engineering Lead</span></b></div><div dir="ltr" style="font-size: 12.8000001907349px;" data-mce-style="font-size: 12.8000001907349px;"><b style="font-size: 12.8000001907349px;" data-mce-style="font-size: 12.8000001907349px;"><span style="color: #666666;" data-mce-style="color: #666666;" color="#666666"><br></span></b></div><div dir="ltr" style="color: #444444; font-family: 'arial' , 'verdana' , sans-serif; font-size: 12.8000001907349px;" data-mce-style="color: #444444; font-family: 'arial' , 'verdana' , sans-serif; font-size: 12.8000001907349px;"><div style="font-family: 'arial' , sans-serif; color: #222222; font-size: 12.8000001907349px;" data-mce-style="font-family: 'arial' , sans-serif; color: #222222; font-size: 12.8000001907349px;"><b style="font-family: 'arial'; font-size: small; line-height: 14.9499998092651px; white-space: pre-wrap;" data-mce-style="font-family: 'arial'; font-size: small; line-height: 14.9499998092651px; white-space: pre-wrap;"><a href="https://quickleft.com/" style="color: #0033cc;" data-mce-href="https://quickleft.com/" data-mce-style="color: #0033cc;"><span style="color: #000000;" data-mce-style="color: #000000;" color="#000000">Quick Left, Inc.</span></a></b><br data-mce-bogus="1"></div><div style="font-family: 'arial' , sans-serif; color: #222222; font-size: 12.8000001907349px;" data-mce-style="font-family: 'arial' , sans-serif; color: #222222; font-size: 12.8000001907349px;"><span style="color: #000000; font-family: 'arial'; white-space: pre-wrap; line-height: 1.15; font-size: small; background-color: transparent;" data-mce-style="color: #000000; font-family: 'arial'; white-space: pre-wrap; line-height: 1.15; font-size: small; background-color: transparent;"><b>Boulder </b></span><span style="font-size: 12.8000001907349px;" data-mce-style="font-size: 12.8000001907349px;"><span style="color: #999999;" data-mce-style="color: #999999;" color="#999999"><b>|</b></span></span><b style="color: #000000; font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" data-mce-style="color: #000000; font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;">&nbsp;</b><b style="color: #000000; font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" data-mce-style="color: #000000; font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;">Denver</b><span style="font-size: 12.8px; background-color: transparent; color: #999999;" data-mce-style="font-size: 12.8px; background-color: transparent; color: #999999;" color="#999999"><b style="font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" data-mce-style="font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;">&nbsp;</b><span style="font-size: 12.8000001907349px;" data-mce-style="font-size: 12.8000001907349px;"><b>|</b></span></span><b style="color: #000000; font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" data-mce-style="color: #000000; font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;"> </b><b style="color: #000000; font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" data-mce-style="color: #000000; font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;">Portland</b><span style="font-size: 12.8px; background-color: transparent; color: #999999;" data-mce-style="font-size: 12.8px; background-color: transparent; color: #999999;" color="#999999"><b><span style="font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" data-mce-style="font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;">&nbsp;</span><span style="font-size: 12.8000001907349px;" data-mce-style="font-size: 12.8000001907349px;">|</span></b></span><b style="color: #000000; font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" data-mce-style="color: #000000; font-family: 'arial'; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;"> San Francisco</b></div><div><span style="font-size: 12.8000001907349px;" data-mce-style="font-size: 12.8000001907349px;"><p style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;" data-mce-style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;"><span style="color: #666666; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; background-color: transparent;" data-mce-style="color: #666666; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; background-color: transparent;">1 (844) QL-NERDS</span></p><p style="font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;" data-mce-style="font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;"><span style="color: #666666; font-family: arial,sans-serif;" data-mce-style="color: #666666; font-family: arial,sans-serif;" face="arial, sans-serif" color="#666666">@nonsensery</span></p><p style="font-family: 'arial' , sans-serif; color: #222222; margin: 0px;" data-mce-style="font-family: 'arial' , sans-serif; color: #222222; margin: 0px;"><br></p></span><p dir="ltr" style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;" data-mce-style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-family: 'arial'; color: #000000; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;" data-mce-style="font-family: 'arial'; color: #000000; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;"><a href="https://github.com/quickleft" style="color: #0033cc;" data-mce-href="https://github.com/quickleft" data-mce-style="color: #0033cc;"><img style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;" alt="" data-mce-style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;"></a><a href="https://www.facebook.com/quickleft" style="color: #0033cc;" data-mce-href="https://www.facebook.com/quickleft" data-mce-style="color: #0033cc;"><img style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;" alt="" data-mce-style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;"></a><a href="https://twitter.com/quickleft" style="color: #0033cc;" data-mce-href="https://twitter.com/quickleft" data-mce-style="color: #0033cc;"><img style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;" alt="" data-mce-style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;"></a><a href="https://instagram.com/quick_left/" style="color: #0033cc;" data-mce-href="https://instagram.com/quick_left/" data-mce-style="color: #0033cc;"><img style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;" alt="" data-mce-style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;"></a><a href="https://www.flickr.com/photos/quickleft" style="color: #0033cc;" data-mce-href="https://www.flickr.com/photos/quickleft" data-mce-style="color: #0033cc;"><img style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;" alt="" data-mce-style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;"></a><a href="https://vimeo.com/quickleft" style="color: #0033cc;" data-mce-href="https://vimeo.com/quickleft" data-mce-style="color: #0033cc;"><img style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;" alt="" data-mce-style="border: 0px; padding: 0px; color: #222222; font-family: 'arial' , sans-serif; font-size: 12.8000001907349px; line-height: normal; white-space: normal; vertical-align: middle;"></a></span><br data-mce-bogus="1"></p><p dir="ltr" style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;" data-mce-style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;"><br></p><p dir="ltr" style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;" data-mce-style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-family: 'arial'; color: #000000; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;" data-mce-style="font-family: 'arial'; color: #000000; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;"><span style="font-size: small;" data-mce-style="font-size: small;" size="2"><a style="color: #1155cc; text-decoration: underline;" data-mce-style="color: #1155cc; text-decoration: underline;"></a></span></span><br></p><div style="font-family: 'arial' , sans-serif;" data-mce-style="font-family: 'arial' , sans-serif;"><span style="vertical-align: baseline; white-space: pre-wrap;" data-mce-style="vertical-align: baseline; white-space: pre-wrap;"><span style="color: #35d990;" data-mce-style="color: #35d990;"><span style="font-family: arial,helvetica,sans-serif; font-size: small;" data-mce-style="font-family: arial,helvetica,sans-serif; font-size: small;" face="arial, helvetica, sans-serif" size="2"><b>What's it like to work with us? </b></span></span><span style="font-size: 12.8000001907349px; font-family: 'arial';" data-mce-style="font-size: 12.8000001907349px; font-family: 'arial';"><i style="color: #000000; font-family: 'arial' , sans-serif; white-space: normal;" data-mce-style="color: #000000; font-family: 'arial' , sans-serif; white-space: normal;">TrainingPeaks, iTriage, and Ping Identity share their stories in this short video</i><i style="font-family: 'arial' , sans-serif; white-space: normal;" data-mce-style="font-family: 'arial' , sans-serif; white-space: normal;"><span style="color: #500050;" data-mce-style="color: #500050;" color="#500050">&nbsp;</span><a href="https://vimeo.com/92286352" style="color: #0033cc;" data-mce-href="https://vimeo.com/92286352" data-mce-style="color: #0033cc;"><span style="color: #666666;" data-mce-style="color: #666666;" color="#666666">A Client's View</span></a></i><span style="font-family: 'arial' , sans-serif; white-space: normal;" data-mce-style="font-family: 'arial' , sans-serif; white-space: normal;"><span style="color: #666666;" data-mce-style="color: #666666;" color="#666666">.</span></span></span></span></div></div></div></div></div></div></div></div></div></div><img alt="" style="height: 1px; width: 1px; border-width: 0; padding: 0; margin: 0;" data-mce-style="height: 1px; width: 1px; border-width: 0; padding: 0; margin: 0;" border="0" height="1" width="1"><div class="_stretch"><span class="body-text-content">_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" data-mce-href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" data-mce-href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></span></div></div></blockquote></div></div></body></html>