-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing the "bind" operator. <- #431
Comments
I've certainly found |
I can see it being very useful in the right circumstances, but I don't think it is common enough to be an operator. I'd rather stumble across The |
You can even extend Function's prototype making it even easier: fn: (x,y,z) -> x + y + z bound_fn: fn.bind @, 1, 2 |
Thanks for the feedback. The bind operator is now gone on master, along with the couple of places where we made use of it. The documentation will be updated to reflect this change for the next version. |
Haha. It's too late now, but I use the <- operator a lot (1 in 10 lines) and find it very helpful and clearer to read than bind syntax (not having to type bind everywhere was a big selling point for coffeescript to me) - but yeah - if it ever is considered for reinclusion I would like that. |
bnolan: can you gist an example of the bind-in-1-of-10-lines code? There might be a different way... |
From talking on the irc channel, we can fix a lot of it by using the fat arrow when defining methods, but I'm still working on porting our app - then i'll know how many times we actually need <-. |
I really hope this is re-evaluated Where => helps you to scope to the right context 90% of the time, <- would have helped creating super clean curried functions.
|
mental note: 2010 is not 2011. |
Late, but I'm with bnolan: I use bind all the time, and usually not for currying. I don't really understand why the operator was removed, but I certainly feel its absence. Any plans for bringing <- back, or suggestions for re-implementing it myself? |
@JustinMorgan Just use Underscore (or your own utils implementation), it shouldn't be a ton of code. |
It's not too much code, it's just that syntactic sugar for I often find myself setting context at call time, and |
😕 really? Do you, man :P I think you'll find CoffeeScript aint gonna add this particular sugar back for the reasons listed before |
Fair enough. No biggie. |
There seems to be some talk about the "bind" operator being unnecessary in CoffeeScript. My opinion is that the brevity of function literals makes it a bit superfluous. I certainly haven't used it much. How would y'all feel about getting rid of
<-
going forward? For the record, the original ticket that introduced it was here:http://github.com/jashkenas/coffee-script/issues/issue/251
The text was updated successfully, but these errors were encountered: