Thread overview
[Issue 12148] New: The function std.uuid.parseUUID changes an input data
Feb 13, 2014
GoldMax
Feb 13, 2014
Andrej Mitrovic
Feb 14, 2014
GoldMax
Feb 14, 2014
Andrej Mitrovic
[Issue 12148] std.uuid.parseUUID should document that it changes lvalue input data
Feb 15, 2014
yebblies
Mar 10, 2014
Johannes Pfau
February 13, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12148

           Summary: The function std.uuid.parseUUID changes an input data
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: goldmax3000@gmail.com


--- Comment #0 from GoldMax <goldmax3000@gmail.com> 2014-02-12 19:54:04 PST ---
DMD 2.064.2

string s = "d8011e49-7b28-4506-8ceb-3a5bcda875d3";
auto id = parseUUID(s);
assert(s == "d8011e49-7b28-4506-8ceb-3a5bcda875d3"); // Error

After parse the string has zero length.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 13, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12148


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2014-02-12 23:35:18 PST ---
Yeah, it consumes the input range. It should be documented that it does so.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 14, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12148



--- Comment #2 from GoldMax <goldmax3000@gmail.com> 2014-02-14 02:27:19 PST ---
Maybe just remove ref keyword from definition?

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 14, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12148



--- Comment #3 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2014-02-14 02:42:09 PST ---
Parse functions are generally meant to consume the range, this makes them useful for input ranges (or e.g. streams I would think..)

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 15, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12148


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies@gmail.com
            Summary|The function                |std.uuid.parseUUID should
                   |std.uuid.parseUUID changes  |document that it changes
                   |an input data               |lvalue input data


--- Comment #4 from yebblies <yebblies@gmail.com> 2014-02-16 02:47:35 EST ---
This is working as designed (similar to the std.conv.parse functions) although the documentation does not mention this.

For a non-consuming parser for exact strings, use the constructor of UUID.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 10, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12148


monarchdodra@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra@gmail.com


--- Comment #5 from monarchdodra@gmail.com 2014-03-10 05:26:55 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1990

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 10, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12148


Johannes Pfau <johannespfau@gmail.com> changed:

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


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