www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5054] New: Splitter example doesn't work

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5054

           Summary: Splitter example doesn't work
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2010-10-14
10:25:40 PDT ---
DMD 2.048 (not tested with 2.049):

From http://www.digitalmars.com/d/2.0/phobos/std_algorithm.html#Splitter :

import std.algorithm

void main()
{
    assert(equal(splitter("hello  world", ' ') == ["hello", "", "world"]);
}

-- Some 5 lines of error messages..

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 14 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5054


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc


--- Comment #1 from bearophile_hugs eml.cc 2010-10-14 10:58:55 PDT ---
Your code has some bugs, try this:


import std.algorithm;
void main() {
    assert(equal(splitter("hello  world", ' '), ["hello", "", "world"]));
}


Unless you have other problems, you may close this bug report as ivalid.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 14 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5054



--- Comment #2 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2010-10-14
11:14:55 PDT ---
*I* was missing a closing bracket right there, sorry. But the documentation is
the one having the "==" instead of ",".

Docs:

assert(equal(splitter("hello  world", ' ') == [ "hello", "", "world" ]));

Should be:

assert(equal(splitter("hello  world", ' '), [ "hello", "", "world" ]));

So that needs fixing. :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 14 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5054


Shin Fujishiro <rsinfu gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |rsinfu gmail.com
         Resolution|                            |FIXED


--- Comment #3 from Shin Fujishiro <rsinfu gmail.com> 2010-11-16 12:58:46 PST
---
Fixed: http://www.dsource.org/projects/phobos/changeset/2168

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