https://d.puremagic.com/issues/show_bug.cgi?id=5977


[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #5 from [email protected] 2013-11-18 02:46:27 PST ---
After this pull:
https://github.com/D-Programming-Language/phobos/pull/1502

This program:

void main() {
    import std.string, std.stdio;
    auto r = split("a test", "");
    pragma(msg, typeof(r));
    r.writeln;
}

Gives:

string[]
["a", " ", "t", "e", "s", "t"]


And this program:

void main() {
    import std.algorithm, std.stdio;
    auto r = splitter("a test", "");
    r.writeln;
}

Gives the same output:

["a", " ", "t", "e", "s", "t"]



It's different from what Python does:

>>> "a test".split("")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: empty separator


But it's much better than an infinite loop, it can be often useful, and I think
it's acceptable, so I close down the issue.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to