Thread overview
[Issue 1919] New: StringWriter docs are completely unclear
Mar 13, 2008
d-bugmail
Mar 13, 2008
d-bugmail
Mar 13, 2008
Bill Baxter
Mar 13, 2008
d-bugmail
March 13, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1919

           Summary: StringWriter docs are completely unclear
           Product: D
           Version: unspecified
          Platform: PC
               URL: http://www.digitalmars.com/d/2.0/phobos/std_format.html#
                    StringWriter
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: jlquinn@optonline.net


The docs for StringWriter are as follows:

struct StringWriter(Char);
    Implements the static Writer interface for a string. Instantiate it with
the character type, e.g. StringWriter!(char), StringWriter!(wchar), or
StringWriter!(dchar). Regardless of instantiation, StringWriter supports all
character widths; it only is the most efficient at accepting the character type
it was instantiated with.

This explanation generates a bunch of naive questions:

* What's the Writer interface (and don't make me search to find it)?
* What do I do with this struct?
* How does it accept chars?
* What does it do with the chars?


-- 

March 13, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1919


andrei@metalanguage.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|bugzilla@digitalmars.com    |andrei@metalanguage.com




------- Comment #1 from andrei@metalanguage.com  2008-03-13 00:41 -------
Phobos does not have a streaming interface yet. I intended StringWriter as an intermediate solution for the new implementation of writef*. When Phobos will adopt a full-fledged streaming solution, StringWriter will be absorbed into it. For now, please consider StringWriter undocumented and not for general use. (I had to make it public due to a compiler bug.)


-- 

March 13, 2008
d-bugmail@puremagic.com wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=1919
> 
> 
> andrei@metalanguage.com changed:

> 
> ------- Comment #1 from andrei@metalanguage.com  2008-03-13 00:41 -------
> Phobos does not have a streaming interface yet. 

Isn't that what std.stream is supposed to be?

--bb
March 13, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1919





------- Comment #2 from jlquinn@optonline.net  2008-03-13 07:05 -------
(In reply to comment #1)
> Phobos does not have a streaming interface yet. I intended StringWriter as an intermediate solution for the new implementation of writef*. When Phobos will adopt a full-fledged streaming solution, StringWriter will be absorbed into it. For now, please consider StringWriter undocumented and not for general use. (I had to make it public due to a compiler bug.)

OK.  Please consider adding the above text to the StringWriter doc for now, so that people aren't left wondering what it is.


-- 

July 07, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1919


Andrei Alexandrescu <andrei@metalanguage.com> changed:

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




--- Comment #3 from Andrei Alexandrescu <andrei@metalanguage.com>  2009-07-07 06:29:23 PDT ---
StringWriter has been replaced with std.array.Appender.

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