1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
let if = func(cond, on_true) { try { cond(); } catch (true) { on_true(); } catch as default { }; }; let if_else = func(cond, on_true, on_false) { try { cond(); } catch (true) { on_true(); } catch (false) { on_false(); } catch as default { }; };