D equivalent of Python's try..else

Shriramana Sharma via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Nov 20 21:45:35 PST 2015


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).

-- 
Shriramana Sharma, Penguin #395953


More information about the Digitalmars-d-learn mailing list