digitalmars.D.learn - Why is std.string.format a c-style variadic function?
- Andrej Mitrovic (3/3) Sep 25 2011 I'm only asking because I can't use it inside of a pragma(msg) call
- Jacob Carlborg (8/11) Sep 25 2011 std.string.format is using a D-style variadic parameter list. This would...
- Andrej Mitrovic (8/9) Sep 26 2011 The compiler disagrees with you:
- Steven Schveighoffer (7/16) Sep 26 2011 That's likely a bug. D variadic functions push the TypeInfo of each
- Jacob Carlborg (4/24) Sep 26 2011 Yes, that is not a C-style variadic function.
- Andrej Mitrovic (1/1) Sep 26 2011 Hmm yea, the docs say so too. Sorry for the noise then. :)
- Ellery Newcomer (2/15) Sep 26 2011 std.metastrings.Format wouldn't be what you want, would it?
- Andrej Mitrovic (2/3) Sep 26 2011 Yep it is, Jonathan mentioned it above.
- Ellery Newcomer (9/14) Sep 26 2011 thunderbird hates me. second time I give an answer made redundant by
- travert phare.normalesup.org (Christophe) (8/18) Sep 27 2011 I've got the same problem with most of Jonathan's posts. I use flrn, an
- Dmitry Olshansky (4/18) Sep 27 2011 --
I'm only asking because I can't use it inside of a pragma(msg) call since CTFE can't do C-style variadic functions yet. Is `format` defined this way for performance reasons? (to avoid template bloat?)
Sep 25 2011
On 2011-09-26 05:39, Andrej Mitrovic wrote:I'm only asking because I can't use it inside of a pragma(msg) call since CTFE can't do C-style variadic functions yet. Is `format` defined this way for performance reasons? (to avoid template bloat?)std.string.format is using a D-style variadic parameter list. This would be a C-style variadic parameter list: extern (C) string format (int c, ...); It might just be an old function from D1 when template tuple parameters where not just that much. -- /Jacob Carlborg
Sep 25 2011
On 9/26/11, Jacob Carlborg <doob me.com> wrote:std.string.format is using a D-style variadic parameter list.The compiler disagrees with you: D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\string.d(2432): Error: function std.string.format C-style variadic functions are not yet implemented in CTFE L2432: string format(...) I don't see any other format() overloads in std.string.
Sep 26 2011
On Mon, 26 Sep 2011 08:42:09 -0400, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:On 9/26/11, Jacob Carlborg <doob me.com> wrote:That's likely a bug. D variadic functions push the TypeInfo of each parameter onto the stack as well as the parameters themselves. Unfortunately, it's probably just a wrong error message, I doubt D variadic parameters are supported in CTFE. -Stevestd.string.format is using a D-style variadic parameter list.The compiler disagrees with you: D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\string.d(2432): Error: function std.string.format C-style variadic functions are not yet implemented in CTFE L2432: string format(...) I don't see any other format() overloads in std.string.
Sep 26 2011
On 2011-09-26 17:12, Steven Schveighoffer wrote:On Mon, 26 Sep 2011 08:42:09 -0400, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:Yes, that is not a C-style variadic function. -- /Jacob CarlborgOn 9/26/11, Jacob Carlborg <doob me.com> wrote:That's likely a bug. D variadic functions push the TypeInfo of each parameter onto the stack as well as the parameters themselves. Unfortunately, it's probably just a wrong error message, I doubt D variadic parameters are supported in CTFE. -Stevestd.string.format is using a D-style variadic parameter list.The compiler disagrees with you: D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\string.d(2432): Error: function std.string.format C-style variadic functions are not yet implemented in CTFE L2432: string format(...) I don't see any other format() overloads in std.string.
Sep 26 2011
Hmm yea, the docs say so too. Sorry for the noise then. :)
Sep 26 2011
On 09/26/2011 07:42 AM, Andrej Mitrovic wrote:On 9/26/11, Jacob Carlborg <doob me.com> wrote:std.metastrings.Format wouldn't be what you want, would it?std.string.format is using a D-style variadic parameter list.The compiler disagrees with you: D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\string.d(2432): Error: function std.string.format C-style variadic functions are not yet implemented in CTFE L2432: string format(...) I don't see any other format() overloads in std.string.
Sep 26 2011
On 9/26/11, Ellery Newcomer <ellery-newcomer utulsa.edu> wrote:std.metastrings.Format wouldn't be what you want, would it?Yep it is, Jonathan mentioned it above.
Sep 26 2011
On 09/26/2011 11:15 AM, Andrej Mitrovic wrote:On 9/26/11, Ellery Newcomer <ellery-newcomer utulsa.edu> wrote:thunderbird hates me. second time I give an answer made redundant by orphaned subthread. I'll counter by giving random unsolicited thoughts on Format: don't use it for codegen (or any long format strings, I suppose). dmd chokes on it very quickly. format specifiers could use positional parameters or something. Last summer I actually wrote a Replace template to scratch that itch. dmd choked on it pretty quickly too.std.metastrings.Format wouldn't be what you want, would it?Yep it is, Jonathan mentioned it above.
Sep 26 2011
Ellery Newcomer , dans le message (digitalmars.D.learn:29819), a écrit :On 09/26/2011 11:15 AM, Andrej Mitrovic wrote:I've got the same problem with most of Jonathan's posts. I use flrn, an obsure news reader that nobody here probably knows about, so I thought it was just me. It seems that the Reference field in Jonathan's posts are unusual and break threads in some news reader. Would anyone know a solution (either for Elley and me, or for Jonathan)? -- ChristopheOn 9/26/11, Ellery Newcomer <ellery-newcomer utulsa.edu> wrote:thunderbird hates me. second time I give an answer made redundant by orphaned subthread.std.metastrings.Format wouldn't be what you want, would it?Yep it is, Jonathan mentioned it above.
Sep 27 2011
On 27.09.2011 4:43, Ellery Newcomer wrote:On 09/26/2011 11:15 AM, Andrej Mitrovic wrote:FWIW I'm on thunderbird, and all is fine here.On 9/26/11, Ellery Newcomer<ellery-newcomer utulsa.edu> wrote:thunderbird hates me. second time I give an answer made redundant by orphaned subthread.std.metastrings.Format wouldn't be what you want, would it?Yep it is, Jonathan mentioned it above.I'll counter by giving random unsolicited thoughts on Format: don't use it for codegen (or any long format strings, I suppose). dmd chokes on it very quickly. format specifiers could use positional parameters or something. Last summer I actually wrote a Replace template to scratch that itch. dmd choked on it pretty quickly too.-- Dmitry Olshansky
Sep 27 2011