Scoped binding of a method to an object

Mark S. Miller erights at
Tue Oct 15 06:40:48 PDT 2013

On Tue, Oct 15, 2013 at 3:39 AM, Andreas Rossberg <rossberg at>wrote:

> On 15 October 2013 03:09, Allen Wirfs-Brock <allen at> wrote:
> > I still don't get why so many JS programmer with a FP orientation want
>  to do things with the |this| binding.   |this| is for us OO geeks, if you
> are doing FP you don't need it.
> Well, 'this' comes up because you cannot avoid having to interface
> with OOish APIs that conflicts with FPish composition patterns. For
> example, you'd like to be able to do something like

Using <>

    var bind = Function.prototype.bind;
    var uncurryThis = bind.bind(;"".toLowerCase))

> But map expects a function, while toLowerCase is only available as a
> method. So unless you rewrap all relevant APIs in functional style you
> have to deal with 'this' in one form or the other, and going back and
> forth is not pretty with what JS currently offers. (Mind you, a bind
> operator does not even address this particular example.)
> /Andreas
> _______________________________________________
> es-discuss mailing list
> es-discuss at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list