<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="">FWIW, in Swift 3:</div><div class=""><br class=""></div><div class="">“h j c k”.componentsSeparated(by: “”)</div><div class=""><br class=""></div><div class="">or&nbsp;</div><div class=""><br class=""></div><div class="">“h j c k”.componentsSeparatedByCharacters(in: .whitespace())</div><div class=""><br class=""></div><div class="">which is slightly better.</div><div class=""><br class=""></div><div class="">Regarding the proposal, I love Ruby’s %w(foo bar) and other nice shortcuts like that, but short-term I think we have bigger problems in Swift.</div><div class=""><br class=""></div><div class="">I would love if we had a macro system that would allow something like this, though.</div><br class=""><div class="">
<div class="">— Radek</div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 08 Apr 2016, at 18:38, Ross O'Brien 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=""><div dir="ltr" class="">A function that splits by whitespace would be this:<div class=""><br class=""></div><div class="">"h j c k".componentsSeparatedByCharactersInSet(NSCharacterSet.whiteCharacterSet())</div><div class=""><br class=""></div><div class="">'componentsSeparatedByWhitespace' might be a nice addition as a shortcut for that though?</div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Apr 8, 2016 at 3:38 PM, James Campbell <span dir="ltr" class="">&lt;<a href="mailto:james@supmenow.com" target="_blank" class="">james@supmenow.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;">Pehaps we could have a function that splits by whitespace.</div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;"><br class=""></div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;">"h j c k".split()</div></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><p class=""><b class=""><font color="#cc0000" class="">___________________________________</font></b></p><p class=""><b class="">James⎥Alex's Minder</b></p><p class=""><b class=""><font color="#cc0000" class=""><a href="mailto:james@supmenow.com" target="_blank" class="">james@supmenow.com</a>⎥<a href="http://supmenow.com/" target="_blank" class="">supmenow.com</a></font></b></p><p class=""><b class=""><font size="2" class="">Sup</font></b></p><p class=""><b class=""><font size="2" class="">Runway East
</font></b></p><p class=""><b class=""><font size="2" class="">10 Finsbury Square</font></b></p><p class=""><b class=""><font size="2" class="">London</font></b></p><p class=""><b class=""><font size="2" class="">
EC2A 1AF&nbsp;</font></b></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class=""><div class="h5">
<br class=""><div class="gmail_quote">On 8 April 2016 at 15:05, Ross O'Brien via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Well, you can do this already:<div class="">let words = "rats live on no evil star".componentsSeparatedByString(" ")</div><div class="">so I don't know how much a shortcut is needed.</div><div class=""><br class=""></div><div class="">And given '%w' would currently be impossible in Swift as an operator containing a letter, is there a Swiftier function name or operator for this?</div><div class="gmail_extra"><br class=""><div class="gmail_quote"><div class=""><div class="">On Fri, Apr 8, 2016 at 2:20 PM, Arsen Gasparyan via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div class=""><div dir="ltr" class="">Hey guys,<div class=""><br class=""></div><div class="">Very often we need to create an array strings. It's a routine task and I really like shortcut in Ruby that shortcut makes everyday coding a little bit easier and fun:</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp;words = %w[rats live on no evil star]</div><div class=""><br class=""></div><div class="">What do you think about adding something like this in Swift?</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Arsen</div></div>
<br class=""></div></div><span class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" 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/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></span></blockquote></div><br class=""></div></div>
<br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" 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/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div></div></div>
</blockquote></div><br class=""></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>