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

I don't think so. The language is (almost) whitespace insensitive so the only way to know where a certain control statement terminates is by having the `end` token.

It is unnecessary on the top-level though, since the top-level expression will end where the next one begins. Which means you probably can't have nested class/function definitions.

This technique is not new and is used in OCaml, for example.



This is correct, classes and functions are not dependent on indentation, they just don't need an end. And yes, there are no nested classes and functions (other than in object literals).


Ah I see. Didn't no such a mix was common :)




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

Search: