DIP 1002 (TryElseExpression) added to the queue

Andrea Fontana via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 28 00:52:36 PDT 2016


On Wednesday, 28 September 2016 at 07:47:32 UTC, Andrei 
Alexandrescu wrote:
> scope(exit) do_this_always();
> bool success;
> try
> {
>     do_a_thing();
>     success = true;
> }
> catch(Exception exception)
> {
>     handle_error();
> }
> finally
> {
>    if(success)
>    {
>        depends_on_success_of_thing();
>    }
> }

Why not an optional syntax like:

finally(bool thrown)
{

}

?


More information about the Digitalmars-d mailing list