#.require. clr # try catch in expression not an assignment class TryExpr def main is shared x = 0 x = 4 + try int.parse('123') catch FormatException get 0 - 2 assert x == 127 v = '120' worked = 5 + (try int.parse(v) catch FormatException get 0 - 2) == 125 assert worked v = 'x120' x = 112 worked = 5 + (try int.parse(v) catch FormatException get x - 2) == 115 assert worked dflt = '---' s1 = '00' + try String.format('{1:P}', 0.123)+ '00' catch get dflt + '00' assert s1 == '00---00'