arrow function syntax simplified

Claus Reinke claus.reinke at
Fri Mar 30 13:35:32 PDT 2012

> 2)  Frameworks that currently use |this| as a general parameter passing
> mechanism may find that there are better ways to pass that data, given
> arrow functions and the ability of users to take advantage of lexical
> |this|.
> 3)  There's nothing wrong with long-hand, if that's what you want.

How about using a long-hand library function to convert the implicit
dynamic this into an explicit parameter for short-hand functions?

function getthis(callback) { 
    return function(..args) { return callback(this,..args) } 

wecallyou( getthis( (this,..args)=>... ) )

Wouldn't that work?


More information about the es-discuss mailing list