<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Who isn't going to expect 'split' 'tokenize'/'tokens' 'clean' 'right' 'left' 'pad'?</div><div class="gmail_default" style="font-family:monospace,monospace">A Ruby programmer will recognise 'split' from that list but nothing else.</div><div class="gmail_default" style="font-family:monospace,monospace">An SML programmer will recognise 'tokens' but nothing else.</div><div class="gmail_default" style="font-family:monospace,monospace">A Haskell programmer will wonder whether left/right correspond to justifyLeft/</div><div class="gmail_default" style="font-family:monospace,monospace"> justifyRight and if so, which way around. 'split' might be OK, if only I knew'</div><div class="gmail_default" style="font-family:monospace,monospace"> what you expect it to do.</div><div class="gmail_default" style="font-family:monospace,monospace">An F# or C# programmer will wonder whether left/right correspond to padLeft/</div><div class="gmail_default" style="font-family:monospace,monospace"> padRight and if so, which way around. As for 'split', which of the 10</div><div class="gmail_default" style="font-family:monospace,monospace"> methods by that name did you have in mind?</div><div class="gmail_default" style="font-family:monospace,monospace">A PL/I programmer will expect 'left' and 'right' to correspond to LEFT and RIGHT</div><div class="gmail_default" style="font-family:monospace,monospace"> (or possibly the other way around, depending on whether the focus is where the</div><div class="gmail_default" style="font-family:monospace,monospace"> *string* goes or where the *padding* goes). The others will be a complete mystery.</div><div class="gmail_default" style="font-family:monospace,monospace">A Simula programmer won't have a clue what any of these are and will be disappointed</div><div class="gmail_default" style="font-family:monospace,monospace"> by strings that don't have a movable cursor.</div><div class="gmail_default" style="font-family:monospace,monospace">An OCaml programmer will hope that 'split' is related to 'split_on_char' but will</div><div class="gmail_default" style="font-family:monospace,monospace"> not have any idea what the other functions are.</div><div class="gmail_default" style="font-family:monospace,monospace">A Python programmer may be surprised that 'split' is actually 'tokens'.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">And so it goes. What *does* 'clean' do?</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 9 May 2019 at 02:18, <<a href="mailto:zxq9@zxq9.com">zxq9@zxq9.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2019年5月8日水曜日 10時53分25秒 JST Richard O'Keefe wrote:<br>
> For what it's worth, in Unicode, Line Separator and Paragraph<br>
> Separator are the recommended characters, with CR, LF, CR+LF,<br>
> and of arguably NEL (U+0085) being "legacy".<br>
> <br>
> Again for what it's worth, Unicode defines an algorithm for<br>
> breaking text into word( token)s.<br>
<br>
I don't really mind the term "lexeme", but I've wondered why the<br>
existing tokens/2 function wasn't simply updated to work the way<br>
lexemes/2 works.<br>
<br>
If we needed a new function, it seems the name "tokenize/2" might<br>
have been an easier mental adjustment.<br>
<br>
But anyway, naming things is hard and... meh. For me the unicode<br>
enhancements are a big enough deal that I could *almost* care less<br>
what they are called.<br>
<br>
That said, who isn't going to open a new language's string lib and<br>
expect to find things called "split" "tokenize"/"tokens", "clean",<br>
"right", "left", "pad", etc.?<br>
<br>
-Craig<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>