<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=""><div class="">So instead of chaining convenience initializers to required ones via self.init(), you’d recommend instead assigning them directly to self? I think this would be a nice change; currently it can be hard to know the correct method of chaining initializers (at least as far as I’ve seen when attempting to explain it to newcomers).</div><div class=""><br class=""></div><div class="">Proposed new rules for initialization:</div><div class=""><br class=""></div><div class="">required initializers: must call super (unless base class)</div><div class="">convenience initializers: must assign to self via a required initializer</div><div class=""><br class=""></div><div class="">I think this also would help with the confusion of why convenience methods can’t call super, but required ones can, since now convenience methods can’t chain to&nbsp;<i class="">any</i>&nbsp;initializers directly. Thoughts from others?</div><div class=""><br class=""></div><div style=""><blockquote type="cite" class=""><div class="">On Dec 7, 2015, at 1:33 PM, J. Cheyo Jimenez 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=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">How about something like this?&nbsp;</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">let result = if bool&nbsp;return 1 else 2</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Monday, December 7, 2015, Cameron Knight via swift-evolution &lt;</span><a href="mailto:swift-evolution@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">&gt; wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class="">Why not use a keyword? What if, the keyword 'returning' (or something like that) was used to specify the control flow behavior.</div><div class=""><br class=""></div><div class="">// Replaces ternary operator</div><div class="">let paint.color = returning if door.color == .Red { .Black } else { door.color }</div><div class=""><br class=""></div><div class="">// Supports additional conditions</div><div class="">let paint.finish = returning switch paint.color {</div><div class=""><span style="white-space: pre-wrap;" class="">        </span>case .Black:</div><div class=""><span style="white-space: pre-wrap;" class="">                </span>.Matte</div><div class=""><span style="white-space: pre-wrap;" class="">        </span>case .White:</div><div class=""><span style="white-space: pre-wrap;" class="">                </span>.Eggshell</div><div class=""><span style="white-space: pre-wrap;" class="">        </span>default:</div><div class=""><span style="white-space: pre-wrap;" class="">                </span>.Gloss</div><div class="">}</div><div class=""><br class=""></div><div class="">// Removes ambiguity of single statement behavior</div><div class="">let ages: [Int] = people.map returning { $0.age }</div><div class=""><br class=""></div><div class="">// Perhaps overreaching a bit</div><div class="">let label = returning UILabel(frame: CGRect.zero) {</div><div class=""><span style="white-space: pre-wrap;" class="">        </span>.text = "Hello World"</div><div class=""><span style="white-space: pre-wrap;" class="">        </span>.color = UIColor.red</div><div class="">}</div><div class=""><br class=""></div><div class="">I think it adds clarity without too much syntax bloat. I haven't thought out all the corner cases though, so maybe I'm missing something obvious.</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On Dec 6, 2015, at 4:56 PM, Chris Lattner via swift-evolution &lt;<a target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap: break-word;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 6, 2015, at 12:17 PM, Per Melin &lt;<a target="_blank" class="">p@greendale.se</a>&gt; wrote:</div><br class=""><div class=""><div dir="ltr" class="">On Sat, Dec 5, 2015 at 7:15 PM, Chris Lattner<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a target="_blank" class="">clattner@apple.com</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Further, it is important to consider whether the code written using this will actually be *better* than the code written with these things as statements.&nbsp; For example, the “switch” blocks tend to be very large, and turning them into expressions encourages additional indentation.</blockquote><div class=""><br class=""></div><div class="">If you give functions implicit return at the same time – as in Haskell, Erlang, Scala, Rust, Ruby, Lisp/Scheme/Clojure, etc – &nbsp;there would be no need for additional indentation half of the time.</div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">This isn’t something that I’m personally interested in.&nbsp; I think that it is *feature* of swift that statements an declarations start with keywords.&nbsp; This greatly simplifies the grammar in various ways, and allows declmodifiers to be introduced without taking keywords space. &nbsp;</div><div class=""><br class=""></div><div class="">For example, relevant to this proposal, if/when we support “tail return foo()" for example, you don’t want to take “tail” as a keyword to make “tail foo()” work.</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">Not even Slava Pestov would factor Swift that aggressively.</div></div></div></div></blockquote><br class=""></div><div class="">Underestimating Slava is not a good idea! :-)</div><div class=""><br class=""></div><div class="">-Chris</div></div><br class=""><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=eABgjBqknOdLnwNfyLqbw6U-2BZOY4o2z70lPUq2Lz8gPaV-2BtZo3snpIUa63YT-2FUZ7qwktBbgDiqrJx0-2BuHU6WZH9qLPArfMNX8VuIaDxP5G2VNvIx-2F4oVZotJ-2BAguHQH-2FI6GVGOfMdWRhKTJwJmwmHY-2Bu4unCgotSeZ56Jc8-2B3ICLjGN7rp6fnQeR55fv8SFzDMGwxX3QyCd7aiVLkPdBgdcNbELXZte64dAcsSXrf-2BY-3D" alt="" width="1" height="1" border="0" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=OWK4tSasaK2n-2FQIIcS9Ug-2FuFXG-2BJ3z6cFMLgm306hDcBtnKodRcjTkx57EAnAPddLS9FMUNIBP5iqW-2Bg0owRnkbtaPSKOMhX4sVWFBlJAf0xB9zdDTjRAoYJ8-2BG-2FDEW4Noa8AVBTPyPCNgZKwREJBscd2Jp84OwXv42sBjTc4-2FMYImrg-2BkwBAhklu4MIo3OANyruyX-2Bo-2Bb6Z5VEhn7VaYTqJ53WxX4bz7Ar-2BHjcxMDU-3D" alt="" width="1" height="1" border="0" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""></div></blockquote><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=FQi0a0XaFSqNjcg3ZcZj0gcUifawKfzwuyiJD39rkMMfONyedAnqd5r3QpXUuyh8rCyZWYg3AfNVPtacgmNZRCbt5pn2i2-2BpFFRA9vIVW2mUu0-2BlKFOpPfefmzz87ZpMSGz5MF9-2F3dtA8iWQkuM3NrNpngEE6WbECyNPv5sX-2FmZwn9OTEOLiBYgXHyiBrkCMtziO-2Bw2CJ0-2FyOZ7ey-2FGQqQnHt-2BjCfjt5QTOQR5I7oQ0-3D" alt="" width="1" height="1" border="0" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></body></html>