www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.format example not working

reply "Akakima" <akakima33 gmail.com> writes:
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.

_ 
Jan 28 2011
parent reply "Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> writes:
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
Jan 29 2011
parent "Akakima" <akakima33 gmail.com> writes:
 D1 bugs are still fixed, so bug reports are welcome.

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

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

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

I think that D1 should receive more attention.
 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.

Does not have to be breaking. You could define new names while keeping the old. Thanks for your attention.
Jan 29 2011