digitalmars.D.learn - Variadic arguments transmission
- Victor Nakoryakov (14/14) Aug 01 2005 Hi all.
- Ben Hinkle (6/16) Aug 01 2005 step 1) Walter adds to std.stdio (or someone sends Walter)
- Victor Nakoryakov (6/30) Aug 01 2005 :))) Easy, but unreal.
- David L. Davis (31/50) Aug 01 2005 Ben, to you mean wrapper functions like the following:
- Ben Hinkle (9/42) Aug 01 2005 yeah, though I don't know if calling parameters _arguments and _argptr
- Ben Hinkle (4/8) Aug 01 2005 To me more concrete I'd prefer something like _argtypes. That way there ...
Hi all. What is the easiest way to transmit variadic arguments to function with variadic arguments? E.g. void foo(...) { // some code // bla bla bla writef( ??? ); // here I want to transmit arguments of // `foo` without any changes. } -- Victor (aka nail) Nakoryakov nail-mail<at>mail<dot>ru Krasnoznamensk, Moscow, Russia
Aug 01 2005
"Victor Nakoryakov" <nail-mail mail.ru> wrote in message news:dcl06d$2e4o$1 digitaldaemon.com...Hi all. What is the easiest way to transmit variadic arguments to function with variadic arguments? E.g. void foo(...) { // some code // bla bla bla writef( ??? ); // here I want to transmit arguments of // `foo` without any changes. }step 1) Walter adds to std.stdio (or someone sends Walter) vwritef(TypeInfo[] types, va_list args); step 2) you call vwritef(_arguments,_argptr); without step 1 there isn't much you can do.
Aug 01 2005
Ben Hinkle wrote:"Victor Nakoryakov" <nail-mail mail.ru> wrote in message news:dcl06d$2e4o$1 digitaldaemon.com...:))) Easy, but unreal. -- Victor (aka nail) Nakoryakov nail-mail<at>mail<dot>ru Krasnoznamensk, Moscow, RussiaHi all. What is the easiest way to transmit variadic arguments to function with variadic arguments? E.g. void foo(...) { // some code // bla bla bla writef( ??? ); // here I want to transmit arguments of // `foo` without any changes. }step 1) Walter adds to std.stdio (or someone sends Walter) vwritef(TypeInfo[] types, va_list args); step 2) you call vwritef(_arguments,_argptr); without step 1 there isn't much you can do.
Aug 01 2005
In article <dcl3kc$2hoj$1 digitaldaemon.com>, Ben Hinkle says..."Victor Nakoryakov" <nail-mail mail.ru> wrote in message news:dcl06d$2e4o$1 digitaldaemon.com...Ben, to you mean wrapper functions like the following: if so, I've sent these in a email to Walter at the end of May, requesting these to be added to std.stdio. Guess it's time I resubmited them again, but this time add them to the current D v0.128 std.stdio file before emailing them to him again. :) Walter is a very busy man, so things don't always stick the first time. <g> David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.htmlHi all. What is the easiest way to transmit variadic arguments to function with variadic arguments? E.g. void foo(...) { // some code // bla bla bla writef( ??? ); // here I want to transmit arguments of // `foo` without any changes. }step 1) Walter adds to std.stdio (or someone sends Walter) vwritef(TypeInfo[] types, va_list args); step 2) you call vwritef(_arguments,_argptr); without step 1 there isn't much you can do.
Aug 01 2005
yeah, though I don't know if calling parameters _arguments and _argptr should be the names since they are the names made up by the compiler. My own preference would be for names not using the _ and in the case of _arguments I wish Walter would have picked a different name since that name does not indicate it is the types of the arguments and not the arguments themselves. Plus I know overloading ... works in this case but still personally I'd prefer the vfoo naming convention. Maybe that's just being paranoid about the ambiguity.if so, I've sent these in a email to Walter at the end of May, requesting these to be added to std.stdio. Guess it's time I resubmited them again, but this time add them to the current D v0.128 std.stdio file before emailing them to him again. :)okWalter is a very busy man, so things don't always stick the first time. <g> David L. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!" ------------------------------------------------------------------- MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html
Aug 01 2005
My own preference would be for names not using the _ and in the case of _arguments I wish Walter would have picked a different name since that name does not indicate it is the types of the arguments and not the arguments themselves.To me more concrete I'd prefer something like _argtypes. That way there are two implicit variables _argptr of type void* and _argtypes of type TypeInfo[]. By convention user code that takes _argtypes and _argptr inputs would remove the _ in the parameter names to get argtypes and argptr.
Aug 01 2005