3 ms·
I was the original reported of https://github.com/jashkenas/coffeescript/issues/238 https://github.com/jashkenas/coffeescript/issues/238 . And the short answer
by onn 12y ago
I was the original reported of https://github.com/jashkenas/coffeescript/issues/238 https://github.com/jashkenas/coffeescript/issues/238 . And the short answer is: not that easy. Coffeescript wants to keep the semantics of javascript, but it wants to not have the noise of "var x = ..." all the time.
- jay_kyburz 12y agoThanks for the link. Reading the good discussion now.
- jay_kyburz 12y agoI understand that what they have implemented was a deliberate decision, but wouldn't actually be easier to simply to identify that a variable is new to a particular scope and generate a var statement at the top of the javaScript function definition? Does the compiler have any notion of scope? edit: oh right, you need nonlocal or := if you want to access the outer scope.