std.format example not working

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Sat Jan 29 01:54:42 PST 2011


On Fri, 28 Jan 2011 23:30:06 -0500, Akakima wrote:

> Firt, i would like to know if you are interested in receiving comments
> an bug reports for DMD V1.

D1 bugs are still fixed, so bug reports are welcome.

  http://d.puremagic.com/issues/

D1 has been declared stable, though, so there is usually no point in 
submitting enhancement requests for it.


> If yes, then the following example does not work:
> 
> http://www.digitalmars.com/d/1.0/phobos/std_format.html
> 
> import std.c.stdio;
> import std.format;
> void formattedPrint(...)
> {
>   void putc(char c)  {fputc(c, stdout);} std.format.doFormat(&putc,
>   _arguments, _argptr);
> }
> 
> 
> declaring: void putc(dchar c) fixes the problem.

That's a bug in the documentation, please report. :)


> Also to a D newbee like me, _arguments and _argptr are confusing.
> 
> _arginfo or _argtype is more significant. _argptr could be _arglist or
> _argvalue or _arguments
> 
> Those names would be a better fit to the explanations given.

That, on the other hand, would be a breaking change, so it won't happen.

-Lars


More information about the Digitalmars-d-learn mailing list