October 09, 2008 Re: writef, positional arguments, and array formatting | ||||
|---|---|---|---|---|
| ||||
Posted in reply to KennyTM~ | 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?
Andrei
| |||
October 09, 2008 Re: writef, positional arguments, and array formatting | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | "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
| |||
October 09, 2008 Re: writef, positional arguments, and array formatting | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | 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? > > Andrei May I say "RTFM"? LOL Anyway, the Tango description is in: http://www.dsource.org/projects/tango/wiki/ChapterConversions#Layoutsformatstring You can check the implementation in the source file but I don't know if you guys have resolved those, ahem, silly licensing issues yet. and C#: (in fact .NET in general) http://msdn.microsoft.com/en-us/library/26etazsy.aspx | |||
October 09, 2008 Re: writef, positional arguments, and array formatting | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | 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? Tango has adopted the C# formatting scheme. Googling for it will turn up a lot of links, but here's one: http://blog.stevex.net/index.php/string-formatting-in-csharp/ I don't think Tango currently supports the full formatting spec, but I believe it should. Sean | |||
October 09, 2008 Re: writef, positional arguments, and array formatting | ||||
|---|---|---|---|---|
| ||||
Posted in reply to KennyTM~ | KennyTM~ wrote: > 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? >> >> Andrei > > May I say "RTFM"? LOL I was sure someone would mention that, but then hey, I could say the same in lieu of 90% of my posts, so I thought I can indulge this once. > Anyway, the Tango description is in: > > http://www.dsource.org/projects/tango/wiki/ChapterConversions#Layoutsformatstring > > > You can check the implementation in the source file but I don't know if you guys have resolved those, ahem, silly licensing issues yet. > > and C#: (in fact .NET in general) > > http://msdn.microsoft.com/en-us/library/26etazsy.aspx Thanks! Andrei | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply