Curious thoughts, regarding functional programming

Jacob Carlborg doob at me.com
Wed Oct 12 10:00:56 PDT 2011


On 2011-10-12 18:18, Gor Gyolchanyan wrote:
> You never know when exactly and in which conditions will that delegate
> get called. You can't decide to quit something you don't know anything
> about.

If a function implements something similar to a loop I would like to be 
able to abort it with a return just as you can with a loop built into 
the language.

void loop (void delegate () dg)
{
     while (true)
         dg();
}

loop
{
     if (someCondition)
         return; // stops the loop
}

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list