Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I guess you’re asking about the block part — it’s a minor syntactic convenience and not the main point of the comment. It avoids the word function/lambda or def-block and related syntactic inconvenience like parentheses around and at the end and interference with ASI (when applicable).


You're looking for blocks-as-expressions, e.g. the following is valid Rust:

    let x = {
        whatever;
        5
    }; // assigns 5 to x




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: