digitalmars.D - Variadic Functions
- Miguel Ferreira Simões (11/11) Jan 16 2005 Can I have your opinion about this issue:
- Regan Heath (14/23) Jan 16 2005 or at the very least have some way of combining _arguments and _argptr
- Matthew (2/23) Jan 26 2005 Third'ed
- pragma (5/10) Jan 27 2005 Sexy. Especially since it lets you build your own vararg lists from scr...
- Carlos Santander B. (4/18) Jan 31 2005 FWIW, I agree with this (or any other way to accomplish it).
- =?UTF-8?B?QW5kZXJzIEYgQmrDtnJrbHVuZA==?= (16/32) Feb 03 2005 The only way to do it now is to use the workaround:
Can I have your opinion about this issue: http://www.digitalmars.com/d/archives/digitalmars/D/11254.html In my humble opinion, I think we should be able to write: void function1(...) { } void function2(...) { function1(...); } Is there any problem with this notation? Thanks, Miguel Ferreira Simoes
Jan 16 2005
On Mon, 17 Jan 2005 01:31:09 -0000, Miguel Ferreira Simões <Kobold netcabo.pt> wrote:Can I have your opinion about this issue: http://www.digitalmars.com/d/archives/digitalmars/D/11254.html In my humble opinion, I think we should be able to write: void function1(...) { } void function2(...) { function1(...); }or at the very least have some way of combining _arguments and _argptr back into a ... void function1(...) { } void function2(...) { function1(vararg(_arguments,_argptr)); } or as an even more powerful and generic solution some mechanism to allow you to pass all a functions arguments to another function, sort of like a nested function does.Is there any problem with this notation?It doesn't seem ambiguous to me. Regan
Jan 16 2005
"Regan Heath" <regan netwin.co.nz> wrote in message news:opskp5xzxa23k2f5 ally...On Mon, 17 Jan 2005 01:31:09 -0000, Miguel Ferreira Simões <Kobold netcabo.pt> wrote:Third'edCan I have your opinion about this issue: http://www.digitalmars.com/d/archives/digitalmars/D/11254.html In my humble opinion, I think we should be able to write: void function1(...) { } void function2(...) { function1(...); }or at the very least have some way of combining _arguments and _argptr back into a ... void function1(...) { } void function2(...) { function1(vararg(_arguments,_argptr)); } or as an even more powerful and generic solution some mechanism to allow you to pass all a functions arguments to another function, sort of like a nested function does.
Jan 26 2005
"Regan Heath" <regan netwin.co.nz> wrote in messagevoid function1(...) { } void function2(...) { function1(vararg(_arguments,_argptr)); }Sexy. Especially since it lets you build your own vararg lists from scratch. The only other way to accomplish *that* would be to write a shim. This *definately* gets my vote. - EricAnderton at yahoo
Jan 27 2005
Regan Heath wrote:or at the very least have some way of combining _arguments and _argptr back into a ... void function1(...) { } void function2(...) { function1(vararg(_arguments,_argptr)); } or as an even more powerful and generic solution some mechanism to allow you to pass all a functions arguments to another function, sort of like a nested function does. ReganFWIW, I agree with this (or any other way to accomplish it). _______________________ Carlos Santander Bernal
Jan 31 2005
Carlos Santander B. wrote:The only way to do it now is to use the workaround: void helper(TypeInfo[] arguments, va_list argptr) { } void function1(...) { helper(_arguments,_argptr); } void function2(...) { helper(_arguments,_argptr); } But that does not let you modify the argument list. (e.g. if you want to add or remove any arguments) Assuming that va_list is (void*) is *not* portable. Using std.stdarg's va_arg is the way to get them out... --andersor at the very least have some way of combining _arguments and _argptr back into a ... void function1(...) { } void function2(...) { function1(vararg(_arguments,_argptr)); } or as an even more powerful and generic solution some mechanism to allow you to pass all a functions arguments to another function, sort of like a nested function does. ReganFWIW, I agree with this (or any other way to accomplish it).
Feb 03 2005