std.format example not working

Akakima akakima33 at gmail.com
Fri Jan 28 20:30:06 PST 2011


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

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.

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.

_ 




More information about the Digitalmars-d-learn mailing list