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

It makes closures relatively clean, since the syntax is usable directly as an initializer for constants.

    var f = {arg
        body
    }

    const main = {
         g({arg; body})
    }


Yay! I have an irrational love of this sort of thing; I enjoy the reinforcement of the idea that functions are just another kind of value.

It seems like there really aren't that many languages with this symmetry (most lisps, JS/CS, Haskell, ...?), which I find a little strange.


So a semicolon plays three roles in the code (arg; statement; block;;), and it seems that ;; has higher precedence when ;;; is seen.


Sort of.

Endlines have one role: They end statements, although there are potentially many kinds of statement that they end.

';' and '\n' are alternative equivalent renderings of line endings. ';;' ends blocks. And yes, the lexer does the usual longest prefix match.




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

Search: