<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>I'm very much a fan of the end result of this proposal, i.e. some way to convert from a collection of code units into a String. Initially I thought the proposed API was acceptable, barring some quibbles about naming, but I think Dave Abrahams has made some good points in this thread, and so I'll just say that I very much support getting this kind of functionality in the stdlib, but if Dave Abrahams thinks that the API as proposed isn't what we want in the long term, then I'll defer to his judgement.<br></div>
<div> </div>
<div>Also, given the proposed API, the input really should be a SequenceType. I recognize that it's calling through to _StringBuffer.fromCodeUnits() which takes a CollectionType, but the only reason that takes a CollectionType is so it can pre-calculate the size of the UTF-16 buffer, and I don't think that limitation should be exposed through the public API. It would be better to change _StringBuffer.fromCodeUnits() to take a SequenceType and use the _preprocessingPass machinery to choose between the fast-path of pre-allocating the buffer and a slow path of growing the buffer as needed.<br></div>
<div> </div>
<div>-Kevin Ballard</div>
<div> </div>
<div>On Thu, Feb 11, 2016, at 04:41 PM, Douglas Gregor wrote:<br></div>
<blockquote type="cite"><p style="margin-top:0px;margin-bottom:16px;color:rgb(51, 51, 51);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);">Hello Swift community,<br></p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51, 51, 51);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);">The review of SE-0027 "Expose code unit initializers on String" begins now and runs through February 16, 2016. The proposal is available here:<br></p><blockquote style="margin-top:0px;margin-right:0px;margin-bottom:16px;margin-left:0px;padding-top:0px;padding-right:15px;padding-bottom:0px;padding-left:15px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221, 221, 221);background-color:rgb(255, 255, 255);"><div style="margin-top:0px;margin-bottom:0px;"><span class="colour" style="color:rgb(119, 119, 119)"><span class="font" style="font-family:'Helvetica Neue', ' Helvetica', ' Segoe UI', ' Arial', ' freesans', ' sans-serif', ' Apple Color Emoji', ' Segoe UI Emoji', ' Segoe UI Symbol'"><span class="size" style="font-size:medium"><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0027-string-from-code-units.md">https://github.com/apple/swift-evolution/blob/master/proposals/0027-string-from-code-units.md</a></span></span></span><br></div>
</blockquote><p style="margin-top:0px;margin-bottom:16px;color:rgb(51, 51, 51);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);">Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at<br></p><blockquote style="margin-top:0px;margin-right:0px;margin-bottom:16px;margin-left:0px;padding-top:0px;padding-right:15px;padding-bottom:0px;padding-left:15px;color:rgb(119, 119, 119);border-left-width:4px;border-left-style:solid;border-left-color:rgb(221, 221, 221);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);"><div style="margin-top:0px;margin-bottom:0px;"><a style="background-color:transparent;color:rgb(64, 120, 192);text-decoration:none;" href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div>
</blockquote><p style="margin-top:0px;margin-bottom:16px;color:rgb(51, 51, 51);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);">or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:<br></p><blockquote style="margin-top:0px;margin-right:0px;margin-bottom:16px;margin-left:0px;padding-top:0px;padding-right:15px;padding-bottom:0px;padding-left:15px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221, 221, 221);background-color:rgb(255, 255, 255);"><p style="color:rgb(119, 119, 119);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;margin-top:0px;margin-bottom:16px;">Proposal link:<br></p><blockquote style="margin-top:0px;margin-right:0px;margin-bottom:16px;margin-left:0px;padding-top:0px;padding-right:15px;padding-bottom:0px;padding-left:15px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221, 221, 221);"><div style="margin-top:0px;margin-bottom:0px;"><span class="colour" style="color:rgb(119, 119, 119)"><span class="font" style="font-family:'Helvetica Neue', ' Helvetica', ' Segoe UI', ' Arial', ' freesans', ' sans-serif', ' Apple Color Emoji', ' Segoe UI Emoji', ' Segoe UI Symbol'"><span class="size" style="font-size:medium"><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0027-string-from-code-units.md">https://github.com/apple/swift-evolution/blob/master/proposals/0027-string-from-code-units.md</a></span></span></span><br></div>
</blockquote><p style="color:rgb(119, 119, 119);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;margin-top:0px;margin-bottom:16px;">Reply text<br></p><blockquote style="color:rgb(119, 119, 119);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:15px;padding-bottom:0px;padding-left:15px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221, 221, 221);"><div style="margin-top:0px;margin-bottom:0px;">Other replies<br></div>
</blockquote></blockquote><h5 style="margin-top:1em;margin-bottom:16px;line-height:1.4;font-size:1em;color:rgb(51, 51, 51);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';background-color:rgb(255, 255, 255);"><a style="background-color:transparent;color:rgb(64, 120, 192);text-decoration:none;display:inline-block;padding-right:2px;line-height:1.1;" href="https://github.com/apple/swift-evolution#what-goes-into-a-review-1"></a>What goes into a review?<br></h5><p style="margin-top:0px;margin-bottom:16px;color:rgb(51, 51, 51);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);">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></p><ul style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51, 51, 51);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);"><li style="">What is your evaluation of the proposal?<br></li><li style="">Is the problem being addressed significant enough to warrant a change to Swift?<br></li><li style="">Does this proposal fit well with the feel and direction of Swift?<br></li><li style="">If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br></li><li style="">How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br></li></ul><p style="margin-top:0px;margin-bottom:16px;color:rgb(51, 51, 51);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);">More information about the Swift evolution process is available at<br></p><blockquote style="margin-top:0px;margin-right:0px;margin-bottom:16px;margin-left:0px;padding-top:0px;padding-right:15px;padding-bottom:0px;padding-left:15px;color:rgb(119, 119, 119);border-left-width:4px;border-left-style:solid;border-left-color:rgb(221, 221, 221);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);"><div style="margin-top:0px;margin-bottom:0px;"><a style="background-color:transparent;color:rgb(64, 120, 192);text-decoration:none;" href="https://github.com/apple/swift-evolution/blob/master/process.md">https://github.com/apple/swift-evolution/blob/master/process.md</a><br></div>
</blockquote><p style="margin-top:0px;margin-bottom:16px;color:rgb(51, 51, 51);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);">Thank you,<br></p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51, 51, 51);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);">Doug Gregor<br></p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51, 51, 51);font-family:'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';font-size:16px;background-color:rgb(255, 255, 255);">Review Manager<br></p><div><u>_______________________________________________</u><br></div>
<div>swift-evolution-announce mailing list<br></div>
<div><a href="mailto:swift-evolution-announce@swift.org">swift-evolution-announce@swift.org</a><br></div>
<div><a href="https://lists.swift.org/mailman/listinfo/swift-evolution-announce">https://lists.swift.org/mailman/listinfo/swift-evolution-announce</a><br></div>
</blockquote><div> </div>
</body>
</html>