MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1j1cw7/coffeescripts_scoping_is_madness/cbahdd3/?context=3
r/programming • u/donatj • Jul 25 '13
315 comments sorted by
View all comments
Show parent comment
1
Yeah.. You can put underscores in front of your names in Coffeescript too. (did I just blow someone's mind?)
1 u/[deleted] Jul 26 '13 And? In coffeescript a.__method will not be changed to something like a.__A__method like in python, which is the entire point of putting underscores in the front of method names in python 3 u/ms_moutarde Jul 26 '13 edited Jul 26 '13 How would the coffeescript compiler distinguish between a javascript function named "foo.__bar" and a coffeescript function named "foo.__bar"?Under your proposed plan the call to the javascript function would be name-mangeled to be "foo.__Foo__bar" which would result in a runtime error.
And? In coffeescript a.__method will not be changed to something like a.__A__method like in python, which is the entire point of putting underscores in the front of method names in python
3 u/ms_moutarde Jul 26 '13 edited Jul 26 '13 How would the coffeescript compiler distinguish between a javascript function named "foo.__bar" and a coffeescript function named "foo.__bar"?Under your proposed plan the call to the javascript function would be name-mangeled to be "foo.__Foo__bar" which would result in a runtime error.
3
How would the coffeescript compiler distinguish between a javascript function named "foo.__bar" and a coffeescript function named "foo.__bar"?
Under your proposed plan the call to the javascript function would be name-mangeled to be "foo.__Foo__bar" which would result in a runtime error.
View all comments
Show parent comment
1
u/[deleted] Jul 26 '13
Yeah.. You can put underscores in front of your names in Coffeescript too. (did I just blow someone's mind?)