Croc icon indicating copy to clipboard operation
Croc copied to clipboard

Trailing function parameters

Open JarrettBillingsley opened this issue 9 years ago • 0 comments

I'm going to be dropping the Haskell-style function calls, but it would be nice to be able to make "control structures" without having to put the close paren after the function. So maybe we can borrow a page from other languages and allow a trailing function literal to be passed as the last parameter to a function:

time.timex() \
{

}

would be identical to

time.timex(\
{

})

Parsing issues: probably have to restrict it to same line, since stuff like this would be ambiguous:

foo()
function bar() { } // func decl, or func literal passed to foo()?

JarrettBillingsley avatar Nov 07 '14 18:11 JarrettBillingsley