Example of real world usage of function bind syntax

Kevin Smith zenparsing at gmail.com
Thu Jun 11 14:31:36 UTC 2015


>
> I'm not entirely sure if it's appropriate, but I just published a library
> called Trine[1] that takes advantage and displays the power of the proposed
> function bind syntax. Consider this my upvote for the proposal. :)
>

It's definitely appropriate, as long as it's clear to users that the `::`
syntax is experimental, non-standard and subject to change.  This is
actually the kind of usage feedback we were hoping to get : )

Has there been any discussion of anyone championing this proposal for
> ES2016? I would very much like to see it land, especially given that I've
> already been using it extensively in production via Babel. :P
>

Not sure you should use it in production, just yet...

I'm the champion for this proposal, and I plan on pursuing it.  I'm not
sure that it will fit into the ES2016 timeline though, given the time
remaining and other priorities (like async/await).  To be honest, I'm not
overly worried about which "train" it leaves on.

Since you brought it up...

I've been considering reducing the scope of the proposal, focusing on the
"immediate apply" aspect of the operator, while leaving open the option of
adding the other features at a later time.  Specifically,

- Remove the prefix form of the operator.
- Restrict the syntax such that an argument list is required after the
right operand.

In other words, these forms would no longer be valid under the proposal
(although they could be re-introduced in another proposal):

    let bf1 = ::obj.foo.bar;
    let bf2 = obj::foo;

But this would still be OK:

    obj::foo(bar);

Given your experience with the operator and your use cases, would you still
be in favor of such a minimal proposal?

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150611/ec4dd124/attachment.html>


More information about the es-discuss mailing list