D equivalent of Python's try..else

rsw0x via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Nov 22 06:10:22 PST 2015


On Sunday, 22 November 2015 at 10:01:48 UTC, Kagamin wrote:
> As an idiomatic option there can be `finally(exit)`, 
> `finally(success)` and `finally(failure)` that would mirror 
> semantics of scope guards.

how does this differ from just putting a scope(failure) inside 
the try block?
it only triggers if no exception is thrown, else it goes to the 
catch.


More information about the Digitalmars-d-learn mailing list