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

1

u/[deleted] Jul 26 '13

The thing I sometimes run into in CS is that defining a lambda as the first argument of a function when there are more than one argument does only work if you put the thing in brackets:

foo((->), bar)

1

u/jmhnilbog Aug 01 '13

What's wrong with:

foo (x)->
  console.log 'x'
, bar

I'm assuming your lambda would have some content. Without any, this won't work.

1

u/[deleted] Aug 01 '13

I didn't know that that works. Thanks.