<div dir="ltr"><br><div class="gmail_quote">On Thu, Oct 9, 2008 at 7:51 PM, Richard O'Keefe <span dir="ltr"><<a href="mailto:ok@cs.otago.ac.nz">ok@cs.otago.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I note that "explode" has historically meant<br>
"to break a string (or equivalent) into a list of its<br>
  single-character elements",<br>
which is not all that split/unjoin does.<br>
<br>
Some of the names in the 'lists' module were copied<br>
from Haskell.  It's a pity that Haskell's "splitAt"<br>
was copied as "split".<br>
<br>
I dare say Ruby and PHP (?) got the name 'split'<br>
from Perl, which got it from 'AWK', where a<br>
*regular expression* controls the splitting.</blockquote><div><br>I am sure they did. <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
This is the other reason for preferring to call the<br>
operation 'unjoin': anyone familiar with "split" in<br>
AWK, Perl, &c will expect string:split/2 to take a<br>
regular expression parameter, and this one DOESN'T.</blockquote><div> </div><div>Ok, then to preserve the Principle Of Least Astonishment, let string:split accept a regular expression, which is just a string with special RE operators. If the string contains no RE operators, use an optimized special case of split (like the one you wrote) that does not use an RE engine. Get the best of both worlds.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
There is, or should be, a regular pattern<br>
        words <-> unwords<br>
        lines <-> unlines<br>
        unjoin <-> join<br>
Oh well, sort of regular...<br>
</blockquote><div><br>Sorry, and no offense meant, but that's really horribly ugly. Reminds me of that sentence, "A not unblack dog chased a not unbrown rabbit across a not ungreen field." Should the opposite of down then be "undown"? Languages (well, I can vouch for two, anyway) contain many complementary words that are not syntactically constructable by adding or removing "un-". Like split and join, for example. Hard and soft. Big and small. Break and mend. Wake and sleep. <br>
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
When I clicked on the Documentation link on the scutil page,<br>
I got to some sort of Wiki thingie, with no documentation<br>
that I could see.<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</div></div></blockquote></div><br></div>