r/programming • • Dec 22 '11

The Problem with Implicit Scoping in CoffeeScript

http://lucumr.pocoo.org/2011/12/22/implicit-scoping-in-coffeescript/
83 Upvotes

116 comments sorted by

View all comments

Show parent comment

3

u/redalastor Dec 23 '11

Take a look at coco, it's a fork that aims to fix things it consider broken in coffeescript.

The way it works with regard to scoping is that = means new variable and := means reassign to an existing variable.

This also means that this:

foo = 1
fooo := foo + 1

Will result in a compile time error because of the typo.

1

u/showellshowell Dec 23 '11

I'm not a big fan of coco, but it's worth checking out. Like CS, it also transcompiles to JS, so if it suits your fancy, you still end up with JS compatibility at the end of the day. Like I said, I'm not a big fan, but it's definitely an interesting language, and it will expand your mind a bit.