variadic functions

Jason House jason.james.house at gmail.com
Fri Jan 4 08:06:53 PST 2008


Bill Baxter Wrote:
> 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

I totally agree.  I guess we need someone to champion a solution to these that both makes more sense and preserves efficiency.

I assume having the opApply delegate raising an exception could result in slow handling of break statements?  At the very least, an enum outlining what the return values mean would be nice.  

For variadic functions, using a tuple makes a whole lot more sense.  


More information about the Digitalmars-d-learn mailing list