On Saturday, 21 November 2015 at 05:45:37 UTC, Shriramana Sharma wrote:
Hello. In Python one has the syntax try..except..else.. where code in the else clause will only be executed if an exception does not occur. (Ref: http://stackoverflow.com/a/22579805/1503120)

In D, is there such an idiomatic/canonical construct? The D try statement only seems to support finally (apart from catch).


scope(failure) can be used to run code when an exception is thrown inside the scope, and scope(success) only triggers if the scope exited successfully

http://ddili.org/ders/d.en/scope.html

Reply via email to