Thaddee Tyl (2012-03-06T18:07:34.000Z)
On Tue, Mar 6, 2012 at 6:50 PM, Isaac Schlueter <i at izs.me> wrote:
> A great many letters have been typed regarding the number of letters in the
> word "function".
>
> What if we just made the keyword "function" entirely optional, dart-style?
>
> ShortNamedFunctionDeclaration :Identifier <no_linebreak> ( FormalParameterListopt )
> <no_linebreak> { FunctionBody }
> ShortNamedFunctionExpression :Identifier <no_linebreak> ( FormalParameterListopt )
> <no_linebreak> { FunctionBody } Note that the identifier is no longer
> optional, and that no linebreak is allowed between the parameter list and
> the body, unlike current function decl/exprs.
> myList.forEach(x (item) {
>   item += 2
>   doSomethingElse(item)
>   assert(typeof x === "function")
> })

An interesting property of this syntax is that anonymous functions can
be written this way:

    myList.forEach(λ (item) { doWith(item) })

(it can also be `lambda (item) { ... }`)
github at esdiscuss.org (2013-07-12T02:24:50.350Z)
An interesting property of this syntax is that anonymous functions can
be written this way:

    myList.forEach(? (item) { doWith(item) })

(it can also be `lambda (item) { ... }`)