tc39 / proposal-bind-operator

This-Binding Syntax for ECMAScript
1.75k stars 30 forks source link

:: conflicts with E4X #27

Closed XeCycle closed 8 years ago

XeCycle commented 9 years ago

The operator :: is already used in E4X. It's true that E4X is deprecated and we rarely hear real world usage of it, but js2-mode provides editor support, so when implementing this I had to partially drop E4X support.

I think it better to discuss here whether or not to continue with :: and to be incompatible with E4X; btw .. as suggested by #10 also conflicts.

@dgutov is the active collaborator there, who may have an idea whether E4X support is actually used by anyone.

XeCycle commented 9 years ago

A not-so-serious suggestion: .* in C++ is similar to this in functionality.

shovon commented 9 years ago

From the looks of it, @zenparsing, the champion behind the operator, will not be supporting it.

Instead, he's proposing "function pipelining".

Something like:

// Letting `foo`, `bar`, and `baz` be functions that return an array

arrayOfNumbers
  ->foo(el => el*2)
  ->bar(el => el*3)
  ->baz(el => el - 3)

You can read about it at issue #26.

zenparsing commented 8 years ago

Let's not worry about E4X for now. Thanks!