Sounds good that you are going to give significant indentation a try.
Here's a question for you. In Python, if you have a couple of nested lambdas with multiline bodies, getting passed into each other as arguments, do you have to write the closing parenthesis on the correctly-indented line on the other side, or can it be tucked against the inner lambda?
In a hypothetical significant-whitespace CoffeeScript, I'm thinking of this:
elements.each(el =>
el.click(event =>
el.show()))
Versus this: elements.each(el =>
el.click(event =>
el.show()
)
)
Is the second form required to make Python-style whitespace work? a = [
1,
2,
3]Edit: Alright, got a branch that starts with a little significant whitespace going here:
http://github.com/jashkenas/coffee-script/tree/whitespace
It can't handle the first of the two cases mentioned above just yet, but it compiles the second one correctly.
My take on the blocks is that significant whitespace seems to be a natural expression of blocks for your language and fits quite nicely with the aesthetics of the other forms. (The terminal ... choo choo train is not a winning idea.)
I'd rather not add {/}, or begin/end, because it's easy to determine the beginning of the block, it's just closing it that we need a symbol for.
In terms of style, you can certainly indent the period on it's own line if you prefer:
But I'd love to hear more suggestions for alternatives.