Hacker News new | past | comments | ask | show | jobs | submit login

It's not duplicate syntax. `func` adds a named function to the current environment, and `->` only describes an anonymous function. It's the equivalent of `function foo(...)` vs `function(...)` in JS.



Can you not `func(foo){}`? Because that is what would bother me.

`func(foo){}` and `(foo) ->` seem too similar, for my taste at least. Sure, the difference is that one is always anonymous, where as one is sometimes anonymous.. but we've been using `function` as both named and anonymous for ages




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: