satyr / coco

Unfancy CoffeeScript
http://satyr.github.com/coco/
MIT License
497 stars 48 forks source link

No-op argument in backcall #196

Closed vendethiel closed 11 years ago

vendethiel commented 11 years ago

Maybe same as #194 but , arg <- b compiles to b(function (arg) {}); (, arg) <- b compiles correctly

(also, would it be interesting to give the backcall the ability to be alone, so that we can return a function or something ?)

satyr commented 11 years ago

You can't omit parens there. Just use the formal syntax ((, arg) <- b) when ambiguous.

$ coco -bcs
    a
    , b <- c

    a
    (, b) <- c

c(function(a, b){
  a;
  return c(function(arg$, b){});
});