buzz-language / buzz

👨‍🚀 buzz, A small/lightweight statically typed scripting language
https://buzz-lang.dev
MIT License
1.21k stars 34 forks source link

Catch clauses should be blocks #33

Closed giann closed 2 years ago

giann commented 2 years ago

Right now they are functions so we can't do:

fun hello() > bool {
    willFail() catch {
        | here we return from this catch clause instead of returning from the enclosing function
        default -> return false;
    }

    return true;
}