5 ms·
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` to
by a0 11y ago
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.
- k__ 11y agoAh I see. Didn't no such a mix was common :)
- barrelrider 11y agoThis 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).