challenge #2: implement the varargs_reduce metafunction

Jarrett Billingsley kb3ctd2 at yahoo.com
Tue Jan 23 16:33:16 PST 2007


"Andrei Alexandrescu (See Website for Email)" 
<SeeWebsiteForEmail at erdani.org> wrote in message 
news:ep4i7p$2n1t$4 at digitaldaemon.com...
> My previous post defines max by availing itself of a metafunction called
> varargs_reduce. Your challenge is to define it. varargs_reduce takes an
> alias which it assumes is a function of two arguments, and it defines a
> vararg function that applies that alias repeatedly, similarly to the
> reduce primitive that is present in functional languages. Again, for
> background on functional reduce, see e.g.:
>
> http://www.joelonsoftware.com/items/2006/08/01.html
>
> Define varargs_reduce to deduce the result type properly, and to generate 
> code as efficient as possible.
>
>
> Andrei

This post is not meant to be inflammatory.

Answer me this: are you just toying with us, tempting us with things which 
are unimplementable without new features which are secretly being developed 
for D?  Or are you just surreptitiously trying to get the community to write 
a bunch of standard library metacode for you?  ;)

How about this: start a thread in which you disclose all the fancy features 
you (you plural, you and Walter, since you now seem to be the _team_ 
designing D) have been planning.

For that matter, is coming up with crazy new features like inout returns and 
opImplicitCast _all_ Walter's doing?  Or is he fixing bugs? 





More information about the Digitalmars-d mailing list