<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 6, 2016, at 5:26 PM, Alex Johnson via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">(this is mostly a repost of a message I sent to the "[draft]" thread for this proposal, with some light editing to better match terminology in the proposal)</div><div class=""><br class=""></div><div class=""><b class="">What is your evaluation of the proposal?</b></div><div class=""><br class=""></div><div class="">I like this proposal. I think it will bring some much-needed ease-of-use.</div><div class=""><br class=""></div><div class="">I have reservations about the "<font face="monospace, monospace" class="">...</font>" placeholder for the&nbsp;memberwise initialization parameters, though. I know this was suggested by Chris&nbsp;Lattner, so I'm inclined to defer to his judgement. But, here are my thoughts:</div><div class=""><br class=""></div><div class="">First, it's very close to the varags syntax (e.g. "<font face="monospace, monospace" class="">Int...</font>") which can also appear in initializer&nbsp;parameter&nbsp;lists.</div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Second, and I think more important, I'm not sure that it's all that <i class="">useful</i>. It's presence isn't necessary for triggering memberwise initialization synthesis; that is already done by the "memberwise" keyword.</div><div class=""><br class=""></div><div class="">The primary example given in the proposal is:</div><div class=""><br class=""></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class="">memberwise init(anInt: Int, anotherInt: Int, ...) {</font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class="">&nbsp; /* code using anInt and anotherInt */</font></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class="">}</font></div></blockquote><div class=""><br class=""></div><div class="">That is, it's used to indicate where the synthesized parameters appear in the parameter list if there are also custom (non-memberwise)&nbsp;parameters.</div><div class=""><br class=""></div><div class="">My question is, <b class="">could the memberwise initialization parameters always be last?</b> That would eliminate the need for the placeholder.</div><div class=""><br class=""></div><div class="">I don't think I've seen a compelling case for embedding the "<font face="monospace, monospace" class="">...</font>" <i class="">within</i> a list of custom arguments, like:</div><div class=""><br class=""></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class=""><div class=""><font face="monospace, monospace" class="">memberwise init(anInt: Int, ...,&nbsp;anotherInt: Int) {</font></div><div class=""><font face="monospace, monospace" class="">&nbsp; /*&nbsp;code using anInt and anotherInt&nbsp;*/</font></div><div class=""><font face="monospace, monospace" class="">}</font></div></blockquote><div class=""><br class=""></div><div class="">It's been mentioned several times in the discussion of this proposal that this behavior is purely optional. If it turns out that there are rare cases where placing the memberwise params in the middle is useful, authors can use manual initialization.</div></div></div></blockquote><div><br class=""></div><div>Hi Alex, thanks for your review. &nbsp;</div><div><br class=""></div><div>The initial draft of the proposal did exactly what you suggest - it did not include the placeholder and always placed the memberwise parameters last. &nbsp;Personally, I believe the placeholder adds clarity and really liked the idea when Chris suggested it. &nbsp;</div><div><br class=""></div><div>Aside from personal preference, I like that this proposal introduces a “synthesized parameter placeholder” syntax. &nbsp;Similar syntax will also be used in the parameter forwarding proposal mentioned in the future enhancements section of this proposal.</div><div><br class=""></div><div>I think the `…` works really well. &nbsp;That said, I don’t mind if people wish to bikeshed on it. &nbsp;If that discussion starts it is worth noting that one thing I like about the `…` is that it combines with an identifier cleanly. &nbsp;For example : `…memberwise`. &nbsp;</div><div><br class=""></div><div>Combining the placeholder with an identifier allows more than one placeholder to be used in the same parameter list. &nbsp;For example, if you are forwarding memberwise parameters exposed by a super init you might also have `…super`. &nbsp;</div><div><br class=""></div><div>That said, I don’t want the review thread to get distracted with discussions around general parameter forwarding so please just consider this as a preview of how this syntax might scale to future applications. &nbsp;For now, lets keep this thread focused on the review of the current proposal. &nbsp;:)</div><div><br class=""></div><div>Matthew</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jan 6, 2016 at 2:47 PM, Chris Lattner via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Swift community,<br class="">
<br class="">
The review of "Flexible Memberwise Initialization" begins now and runs through January 10th. The proposal is available here:<br class="">
<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0018-flexible-memberwise-initialization.md" rel="noreferrer" target="_blank" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0018-flexible-memberwise-initialization.md</a><br class="">
<br class="">
Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at<br class="">
<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class="">
or, if you would like to keep your feedback private, directly to the review manager.<br class="">
<br class="">
What goes into a review?<br class="">
<br class="">
The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:<br class="">
<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; * What is your evaluation of the proposal?<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; * Is the problem being addressed significant enough to warrant a change to Swift?<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; * Does this proposal fit well with the feel and direction of Swift?<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; * If you have you used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; * How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br class="">
<br class="">
More information about the Swift evolution process is available at<br class="">
<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; <a href="https://github.com/apple/swift-evolution/blob/master/process.md" rel="noreferrer" target="_blank" class="">https://github.com/apple/swift-evolution/blob/master/process.md</a><br class="">
<br class="">
Thank you,<br class="">
<br class="">
-Chris<br class="">
Review Manager<br class="">
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class=""><div dir="ltr" style="font-size:12.8000001907349px" class=""><b style="font-size:small;background-color:transparent" class=""><span style="color:rgb(53,217,144)" class=""><font face="arial, helvetica, sans-serif" class="">Alex Johnson</font></span><font color="#666666" class="">&nbsp;| Engineering Lead</font></b></div><div dir="ltr" style="font-size:12.8000001907349px" class=""><b style="font-size:12.8000001907349px" class=""><font color="#666666" class=""><br class=""></font></b></div><div dir="ltr" style="color:rgb(68,68,68);font-family:Arial,Verdana,sans-serif;font-size:12.8000001907349px" class=""><div style="font-family:arial,sans-serif;color:rgb(34,34,34);font-size:12.8000001907349px" class=""><b style="font-family:Arial;font-size:small;line-height:14.9499998092651px;white-space:pre-wrap" class=""><a href="https://quickleft.com/" style="color:rgb(0,51,204)" target="_blank" class=""><font class="">Quick Left, Inc.</font></a></b></div><div style="font-family:arial,sans-serif;color:rgb(34,34,34);font-size:12.8000001907349px" class=""><span style="font-family: Arial; white-space: pre-wrap; line-height: 1.15; font-size: small; background-color: transparent;" class=""><b class="">Boulder </b></span><span style="font-size:12.8000001907349px" class=""><font color="#999999" class=""><b class="">|</b></font></span><b style="font-family: Arial; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" class="">&nbsp;</b><b style="font-family: Arial; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" class="">Denver</b><font color="#999999" style="font-size:12.8000001907349px;background-color:transparent" class=""><b style="font-family:Arial;font-size:small;line-height:1.15;white-space:pre-wrap;background-color:transparent" class="">&nbsp;</b><span style="font-size:12.8000001907349px" class=""><b class="">|</b></span></font><b style="font-family: Arial; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" class=""> </b><b style="font-family: Arial; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" class="">Portland</b><font color="#999999" style="font-size:12.8000001907349px;background-color:transparent" class=""><b class=""><span style="font-family:Arial;font-size:small;line-height:1.15;white-space:pre-wrap;background-color:transparent" class="">&nbsp;</span><span style="font-size:12.8000001907349px" class="">|</span></b></font><b style="font-family: Arial; font-size: small; line-height: 1.15; white-space: pre-wrap; background-color: transparent;" class=""> San Francisco</b></div><div class=""><font style="font-size:12.8000001907349px" class=""><div style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="color:rgb(102,102,102);font-family:arial,sans-serif;font-size:12.8000001907349px;line-height:normal;background-color:transparent" class="">1 (844) QL-NERDS</span></div><div style="font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;" class=""><font color="#666666" face="arial, sans-serif" class="">@nonsensery</font></div><div style="font-family: arial, sans-serif; color: rgb(34, 34, 34); margin: 0px;" class=""><br class=""></div></font><div style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;" class=""><a href="https://github.com/quickleft" style="color:rgb(0,51,204)" target="_blank" class=""><img src="http://i.imgbox.com/MNlkdRf3.png" style="border:0px;padding:0px;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;line-height:normal;white-space:normal;vertical-align:middle!important" alt="" class=""></a><a href="https://www.facebook.com/quickleft" style="color:rgb(0,51,204)" target="_blank" class=""><img src="http://i.imgbox.com/mZ3v7rXp.png" style="border:0px;padding:0px;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;line-height:normal;white-space:normal;vertical-align:middle!important" alt="" class=""></a><a href="https://twitter.com/quickleft" style="color:rgb(0,51,204)" target="_blank" class=""><img src="http://i.imgbox.com/C2qj69cx.png" style="border:0px;padding:0px;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;line-height:normal;white-space:normal;vertical-align:middle!important" alt="" class=""></a><a href="https://instagram.com/quick_left/" style="color:rgb(0,51,204)" target="_blank" class=""><img src="http://i.imgbox.com/3kcv532Y.png" style="border:0px;padding:0px;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;line-height:normal;white-space:normal;vertical-align:middle!important" alt="" class=""></a><a href="https://www.flickr.com/photos/quickleft" style="color:rgb(0,51,204)" target="_blank" class=""><img src="http://i.imgbox.com/qrtOZXDo.png" style="border:0px;padding:0px;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;line-height:normal;white-space:normal;vertical-align:middle!important" alt="" class=""></a><a href="https://vimeo.com/quickleft" style="color:rgb(0,51,204)" target="_blank" class=""><img src="http://i.imgbox.com/lv7fDapY.png" style="border:0px;padding:0px;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;line-height:normal;white-space:normal;vertical-align:middle!important" alt="" class=""></a></span></div><div style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;" class=""><br class=""></div><div style="line-height: 1.15; font-size: 12.8000001907349px; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-family: Arial; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;" class=""><font size="2" class=""><a value="+13032425536" style="color:rgb(17,85,204);text-decoration:underline" class=""></a></font></span></div><div style="font-family:arial,sans-serif" class=""><span style="vertical-align:baseline;white-space:pre-wrap" class=""><span style="color:rgb(53,217,144)" class=""><font face="arial, helvetica, sans-serif" size="2" class=""><b class="">What's it like to work with us? </b></font></span><font style="font-size:12.8000001907349px;font-family:Arial" class=""><i style="font-family: arial, sans-serif; white-space: normal;" class="">TrainingPeaks, iTriage, and Ping Identity share their stories in this short video</i><i style="font-family:arial,sans-serif;white-space:normal" class=""><font color="#500050" class="">&nbsp;</font><a href="https://vimeo.com/92286352" style="color:rgb(0,51,204)" target="_blank" class=""><font color="#666666" class="">A Client's View</font></a></i><span style="font-family:arial,sans-serif;white-space:normal" class=""><font color="#666666" class="">.</font></span></font></span></div></div></div></div></div></div></div></div>
</div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=eLFMrKDT8iBxZ-2Fbnk-2BZqvSchNN-2FvYXdceA0T7VxwkAflhrD7tw43AEGnufwuVJZw8Do59-2F-2FMus3U1hozBsEznD0SIdxYuNyXu4pilODBtqc9r9pS88bGG8-2BFyuj9qUzvk-2B-2FnUkeCiwHtCs-2B-2FlvxcPyD-2Bl86UWfhXe7whnMzfLts1GFXozJHRBQMzSoI7TTnIE-2Fc8pfutJJrT4X2-2BFb-2FHazJJOd-2FPFwodPPyLZCt8Wec-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>