Hacker News new | ask | show | jobs
by latchkey 5287 days ago
Not sure I understand you or maybe you don't understand me. I was talking about using parens for method/functional calls, not getting rid of them from CS.
1 comments

I understand. If you don't have parens on method calls, how could you use an anonymous function that is not the last parameter? For example:

  doSomething(->
    # stuff happens
  ), onerror
First, your code snippet is wrong: you need a space before your first paren.

In coffeescript you can do any of the following, or a few other variants:

  doSomething ->
      stuff
    , onerror

  doSomething(->
      stuff
    , onerror
  )

  doSomething (->
      stuff
    ), onerror

  doSomething(
    ->
      stuff
    onerror
  )

  doSomething (-> stuff), onerror
I had this question a while back as well. Take a look at the discussion here, including Jeremy's thoughts: https://gist.github.com/1215863
I totally agree with you.