r/programming • • Jul 25 '13

CoffeeScript's Scoping is Madness

http://donatstudios.com/CoffeeScript-Madness
207 Upvotes

315 comments sorted by

View all comments

Show parent comment

4

u/Plorkyeran Jul 25 '13

The short answer is that it's trying to be both map and for, and only partially succeeds at that.

Personally I'd prefer something a bit closer to Python's approach with list comprehensions. If you had to wrap the for block with parentheses to explicitly turn it into a map this problem would go away (and as it happens you already have to do so in most cases).