<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="">I generally agree with Xiaodi. I'm not saying that you need Unicode in your scientific application, but it's very easy to think that you don't need it when you actually do, especially because you don't necessarily get to test yourself. The argument that one doesn't need Unicode is the slippery slope down which current systems found themselves. As French native speaker, my insight is that the potential for misuse of ASCII strings has been demonstrated over and over.<div class=""><br class=""></div><div class="">I view ASCII strings as a mistake for the wider world. Instead of repeating that mistake, I would prefer to understand what kind of parsing/comparison you need to perform and come up with a more convenient solution to that.</div><div class=""><div class=""><div class="">
<br class="Apple-interchange-newline"><span style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;" class="">Félix</span>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">Le 22 août 2016 à 18:44:38, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: 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 class="gmail_extra"><div class="gmail_quote">On Sun, Aug 21, 2016 at 3:04 PM, Richard Ward via swift-evolution<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;" class="">First, this is my first post to a list like this and I could not find the instructions to properly respond to a post in the digest. Does one have to subscribe to the verbose (non digest post) in order to respond to a thread correctly? Or is there a link to some instructions? Thanks.</div></blockquote><div class=""><br class=""></div><div class="">Welcome! Sadly, I don't know of any way to reply to the right thread from the digest.</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""></div><div class="">I come from a scientific/engineering background where I create a lot of utility applications which do not have to be as robust in certain ways as commercial applications which are used by a mass number of people. To be clear, the applications need to work and produce correct results and need to be robust in this way. Python is used by a large portion of the scientific community to create applications such as I mentioned and in large part due to what Michael stated in his original email. I dislike having to scan/read code which has long multiply nested method trains such as </div><div class=""><br class=""></div><div class="">str.characters.count where to me, it is easier to scan/read code such as str.len or len(str)</div></div></blockquote><div class=""><br class=""></div><div class="">I come from a scientific background too and know and love Python (well, *knew*, back in the good ol' 2.* days). Unicode in Python 2 was, if I recall correctly, not exactly a bright spot.</div><div class=""><br class=""></div><div class="">This argument is not persuasive to me. The same issue about long spellings (as compared to other languages) applies pervasively in Swift, but as far as I can tell, in each case brevity is deliberately taking a backseat to correctness. I expect you're bound to encounter, if you ever try (for example) to read a binary format for scientific/engineering uses, spellings such as `UnsafeMutableBufferPointer` and others new to Swift 3 such as `UnsafeRawPointer(ptr).bindMemory(to: T.self)`, `MemoryLayout<T>.size(of: value)`, etc. Each of these is significantly longer than the spelling of similar facilities in, say, C or Python. But it reflects Swift naming guidelines, which were one of the main focuses of Swift 3 evolution. IMO, what you're advocating for, if applied throughout Swift APIs, would be a very broad shift in a diametrically opposite direction on a settled issue.</div><div class=""><br class=""></div><div class="">One Swift renaming that sticks out to me as taking the "Swift way" to its epitome, having skimmed some of the API notes, is this one:<br class=""></div><div class=""><br class=""></div><div class="">```</div><div class=""><div class=""> - Name: NSTimeIntervalSince1970</div><div class=""> SwiftName: timeIntervalBetween1970AndReferenceDate</div></div><div class="">```</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class="">I understand the need for unicode in general purpose / internationalized applications. However, it is overkill for most of what I need to do. Also, I agree with Michael that learning the unicode way of Swift is a barrier to people new to coding.</div><div class=""><br class=""></div><div class="">I am wondering why one can’t make a method extension for String called .len or .length (and for that case make a commonly used subscript extension as well) which conform to a protocol which is constructed as only taking say ascii or simplified string?s This could be put into a “semi-standard” library and people who needed/wanted a simplified interface could access and use it? Couldn’t the existing dull underlying string structure be used for this?</div></div></blockquote><div class=""><br class=""></div><div class="">The beauty of Swift is that it is easy to do this for your own code, and easy to do it correctly. My take would be that your own code would be where such an approach would be most "Swifty."</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><div class="">I also don’t like to have to perform type conversions between floating point numbers but that is for another thread.</div><div class=""><br class=""></div></div><div class="">——</div><div class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Aug 15, 2016, at 1:00 PM, Michael Savich <<a href="mailto:savichmichael@icloud.com" target="_blank" class="">savichmichael@icloud.com</a>> wrote:</div></blockquote><blockquote type="cite" class=""><br class=""><div class=""><span style="font-family: Helvetica; font-size: 24px; 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;" class="">Back in Swift 1.0, subscripting a String was easy, you could just use subscripting in a very Python like way. But now, things are a bit more complicated. I recognize why we need syntax like str.startIndex.advancedBy(x) but it has its downsides. Namely, it makes things hard on beginners. If one of Swift's goals is to make it a great first language, this syntax fights that. Imagine having to explain Unicode and character size to an 8 year old. This is doubly problematic because String manipulation is one of the first things new coders might want to do.<span class=""> </span></span></div></blockquote></span><snip></div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On Aug 15, 2016, at 8:24 PM,Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>> wrote:</div></blockquote><blockquote type="cite" class=""><snip></blockquote><span class=""><blockquote type="cite" class=""><div class=""><span style="float: none; display: inline !important;" class="">But, we also want Swift to support Unicode by default, and we want that </span><span style="float: none; display: inline !important;" class="">support to do things The Right Way(TM) by default. In other words, a user</span><br class=""><span style="float: none; display: inline !important;" class="">should not have to reach for a special type in order to handle arbitrary </span><span style="float: none; display: inline !important;" class="">strings correctly, and I should be able to reassign `a = "你好"` and have </span><span style="float: none; display: inline !important;" class="">things work as expected. So, we also can't have the "easy" string type be </span><span style="float: none; display: inline !important;" class="">the default...</span></div></blockquote></span></div></div></div><br class="">______________________________<wbr 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/<wbr class="">mailman/listinfo/swift-<wbr class="">evolution</a><br class=""><br class=""></blockquote></div><br class=""></div></div><span style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: 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><br style="font-family: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: 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: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: 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: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: 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: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: 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: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: 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: LucidaGrande; font-size: 12px; font-style: normal; font-variant-caps: 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=""></div></div></body></html>