variadic functions

Bill Baxter dnewsgroup at billbaxter.com
Fri Jan 4 01:30:29 PST 2008


Jason House wrote:
> Jarrett Billingsley wrote:
> 
>> "0ffh" <frank at youknow.what.todo.interNETz> wrote in message
>> news:fljc2m$ah7$1 at digitalmars.com...
>>> Hrmmnn... I hope this is not the gazillionth time:
>>>
>>> Can I pass on the parameters from one variadic function to the next?
>>> Just passing on _argptr (in analogy to C) does not seem to work. :(
>> Actually I think it's something like the _three_ gazillionth time ;)
>>
>> You can't do it.  I know.  It's dumb.
>>
>> Actually, passing _argptr in C probably wouldn't work either, at least not
>> portably.
> 
> It's really sad that D, the language I've heard called "C++ without the
> warts", inherits this type of funcitonality.  I know Tango had issues with
> 64 bit gdc because of how the variadic stuff is handled.  It'd be nice to
> see a clean, typesafe alternative/replacement.
> 
> PS: the official docs are at http://www.digitalmars.com/d/function.html
>     They don't comment on platform-specific.

Indeed.  It was one of my first shockers with D.  Variadic args are one 
of the first things I'd be trying to make easier and cleaner if I set 
out to build a better C/C++.

The other shocker to me was how kludgy and raw opApply functions look. 
I still find it weird that I the programmer am responsible for handing D 
back an int from my opApply that D generated to begin with!  It just 
seems wrong that I should have to be the middle man there for an 
implementation detail like that.  (Not to mention that the reason for 
that mystery int is never explained in the documentation, making it all 
the more perplexing).

--bb


More information about the Digitalmars-d-learn mailing list