Anonymous Delegates

Russell Lewis webmaster at villagersonline.com
Mon Jun 16 21:58:36 PDT 2008


Nick Sabalausky wrote:
>  That's not what I was referring to. I meant that if you have a 
function that
> takes a delegate as a paramater, then it would be nice (if it would even be 
> possible for the language to allow this) to rewrite a call to that function 
> like this:
> 
> // From this:
> // (Current method of calling, ugly)
> repeat(7,
> {
>     writefln("Calling Callback");
> });
> 
> // To this (Syntactical sugar):
> // (Not currently allowed, but is it possibly doable?
> // Much nicer-looking.)
> repeat(7)
> {
>     writefln("Calling Callback");
> }

Many people have asked for this; we haven't yet been able to convince 
Walter that it is a good idea.



More information about the Digitalmars-d mailing list