michaelficarra / CoffeeScriptRedux

:sweat: rewrite of the CoffeeScript compiler with proper compiler design principles and a focus on robustness and extensibility
https://michaelficarra.github.com/CoffeeScriptRedux/
BSD 3-Clause "New" or "Revised" License
1.84k stars 110 forks source link

More function arguments options #327

Open vinz243 opened 10 years ago

vinz243 commented 10 years ago

It would be really cool if for example, in addition to this:

func = (foo, bar="bar") ->

We could do for example:

func = (foo [,String bar="bar"], function callback) ->

And it would be translated into:

func = function(foo, bar, callback) {
   if(typeof bar === "function") {
     callback = bar;  
     bar = "bar"
   }
}

And many more other options

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/4107903-more-function-arguments-options?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github).