writef, positional arguments, and array formatting

Steven Schveighoffer schveiguy at yahoo.com
Thu Oct 9 09:54:06 PDT 2008


"Andrei Alexandrescu" wrote
> KennyTM~ wrote:
>> Andrei Alexandrescu wrote:
>>> I wonder how this could be addressed. Should presence of positional 
>>> parameters suppress the "print'em all" approach?
>>>
>>
>> Just use/add the C# (Tango) formatting scheme?
>
> How does that work?

eh.. I'm not sure people who like Phobos/writef would like it ;)

Technically this is not an enabler for allowing preventing the 'print 'em 
all' approach:

Stdout.formatln("{1}, {0}", "arg1", "arg2", "arg3");

prints "arg2, arg1"

It's just the approach that arguments must be specified in the format string 
to be printed.  The format of the token identifiers really isn't important 
here, you can use the same philosophy with %s tokens, as you said.

-Steve 





More information about the Digitalmars-d mailing list