<html><body><div>Thanks for proposing this, Matthew!</div><div><br>Am 30. Dezember 2015 um 03:05 schrieb Matthew Johnson via swift-evolution <swift-evolution@swift.org>:<br><br class=""><div><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><div><blockquote type="cite" class=""><div class=""><div class=""><blockquote type="cite" class=""><blockquote type="cite" class="">* Why the method-based conversion syntax for return values, rather than something a little more like a property declaration?<br class=""><br class=""><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>var number: Int<br class=""><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>forward IntegerType to number {<br class=""><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>static return(newValue: Int) {<br class=""><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>return NumberWrapper(newValue)<br class=""><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>}<br class=""><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>return(newValue: Int) {<br class=""><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>return NumberWrapper(newValue)<br class=""><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>}<br class=""><span class="Apple-tab-span" style="white-space: pre;" data-mce-style="white-space: pre;"> </span>}<br class=""></blockquote><br class="">This is actually a really good idea to consider! I didn’t consider something like this mostly because I didn’t think of it. I’m going to seriously consider adopting an approach along these lines.<br class=""></blockquote><br class="">Great.<br class=""><br class=""><blockquote type="cite" class="">One possible advantage of the approach I used is that the initializer may already exist for other reasons and you would not need to do any extra work.<br class=""></blockquote><br class="">True. But it may also exist and *not* do what you want in the forwarding case. It's easier to explicitly use the right initializer than it is to work around the forwarding system implicitly using the wrong one.<br class=""></div></div></blockquote><div><br class=""></div><div>Right, I am generally leaning pretty strongly towards changing the proposal to use a solution similar to what you suggest.</div></div></div></blockquote></div><div><span><br data-mce-bogus="1"></span></div><div><span>That's great. I was about to suggest something similar (like having to name the conversion functions used in the forward clause) when I read Brent's proposal which is much more elegant, so I'd like to support that. Making this explicit without some "implicit magic" is truely important.<br></span></div><div><span><br data-mce-bogus="1"></span></div><div><span>The one thing I'm missing is some real-life examples which would be really helpful to consider this proposal properly (Dave Abrahams already pointed this out).<br data-mce-bogus="1"></span></div><div><span><br data-mce-bogus="1"></span></div><div><span>-Thorsten</span></div><div><span><br></span><br></div></div></body></html>