Re:CoffeeScript, a little language that compiles to JavaScri...
by scott_s on Thursday December 24, 2009 @07:19PM
(#1014585)
Python does not have multiline lambdas. But Python only uses significant whitespace when it can't use other demarcations. For example, the following is legal:
a = [
1,
2,
3]
Re:CoffeeScript, a little language that compiles to JavaScri...
by aaronsw on Thursday December 24, 2009 @03:53PM
(#1014379)
No.
Re:CoffeeScript, a little language that compiles to JavaScri...
by jashkenas on Thursday December 24, 2009 @04:07PM
(#1014394)
Great. Then let's start a "whitespace" branch, and give it a go.
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.
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:
Versus this: Is the second form required to make Python-style whitespace work?