<div dir="ltr"><div>func initialize<T>(_: T.Type, to: T, count: Int = 1)</div><div> -> UnsafeMutablePointer<T></div><div><br></div><div>I wonder why the first parameter is needed. If one is passing literals, it's always more Swift'y to use 'as'.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-05 6:00 GMT+03:00 L. Mihalkovic via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br><br><div>Regards</div>(From<span> mobile)</span></div><span class=""><div><br>On Jul 3, 2016, at 10:18 AM, Andrew Trick via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><br><div><blockquote type="cite"><div>On Jul 2, 2016, at 8:10 PM, Brent Royal-Gordon via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">I have a pile of naming quibbles; rather than describe them all in prose (which turned into a mess), I've annotated parts of the "Full UnsafeRawPointer API" section in a gist: <</span><a href="https://gist.github.com/brentdax/8f4ed4decafc1d18c4441092baa13cfe" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">https://gist.github.com/brentdax/8f4ed4decafc1d18c4441092baa13cfe</a><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">>.</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"></div></blockquote></div><div><br></div>Let's bikeshed this easy one now... I’m curious what others think:<br><div><br> // In general, I think you "initialize to" a value, not <br> // "initialize with" a value. "with" is needlessly vacuous.<br> // <br> // func initialize<T>(_: T.Type, with: T, count: Int = 1)<br> // -> UnsafeMutablePointer<T><br> func initialize<T>(_: T.Type, to: T, count: Int = 1)<br> -> UnsafeMutablePointer<T><br><br></div><div>`initialize` was recently renamed to `initialized(with:)`.</div><div><br></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Menlo;color:rgb(175,173,36);background-color:rgb(0,0,0)"><span>commit d96b051d28b6042adcc8b8692a918abddf211aec</span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Menlo;color:rgb(245,245,245);background-color:rgb(0,0,0)"><span>Author: Dave Abrahams <<a href="mailto:dabrahams@apple.com" target="_blank">dabrahams@apple.com</a>></span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Menlo;color:rgb(245,245,245);background-color:rgb(0,0,0)"><span>Date: Tue Feb 23 15:12:24 2016 -0800</span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Menlo;color:rgb(245,245,245);background-color:rgb(0,0,0);min-height:11px"><span></span><br></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Menlo;color:rgb(245,245,245);background-color:rgb(0,0,0)"><span> stdlib: initializePointee(_) => initialize(with:)</span></div><p style="margin:0px;font-size:10px;line-height:normal;font-family:Menlo;color:rgb(245,245,245);background-color:rgb(0,0,0);min-height:11px"><span> </span><br></p><div style="margin:0px;font-size:10px;line-height:normal;font-family:Menlo;color:rgb(245,245,245);background-color:rgb(0,0,0)"><span> Tacking "Pointee" on just for unary operations (and especially</span></div><div style="margin:0px;font-size:10px;line-height:normal;font-family:Menlo;color:rgb(245,245,245);background-color:rgb(0,0,0)"><span> operations with an optional count) created inconsistency.</span></div><div><br></div><div>So Swift 3 users have already migrated to this “better” name.</div><div><br></div><div>I agree that initialize(to:) is consistent with the language we use for assigning values. But grammatically, I think initialize(with:) also makes perfect sense and is just as common.</div></div></blockquote><div><br></div></span><div>+1</div><span class=""><br><blockquote type="cite"><div><div><br></div><div>In general, if there’s controversy, I’ll stick with the existing conventions because there’s already enough to debate in this proposal.</div><div><br></div><div>-Andy</div></div></blockquote></span><blockquote type="cite"><div><span>_______________________________________________</span><span class=""><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></span></div></blockquote></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>