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/moohoohoh Jul 25 '13 edited Jul 25 '13

In Haxe everything is an expression, but for/while/try have types Void so 'behave' like statements.

If you do want to have this behaviour for a for loop, array comprehension gives it by encasing the for loop in [] eg [for (i in 0...10) i*10]