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

Which languages? javascript and go are both counter examples. In Go the lexer (sic) determines where a line ends, so if you write

    if (a == b)
        && (c == d) 
it will guess a line end after the first closing paren. WTF?

Python is a totally different beast, and I wouldn't include it in the discussion, because it also uses whitespace for block grouping.



There's no guesswork involved. The carriage return implies a semicolon. The rule is very simple and obvious in use (to me, the code you posted looks wrong - and it is).

http://golang.org/doc/go_spec.html#Semicolons




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

Search: