> Le 23 sept. 2016 à 20:35, Kenneth Powers <[email protected]> a écrit :
> 
> As for resolving ambiguity, why not just do what Scala does 
> <http://stackoverflow.com/questions/19916169/scala-arguments-of-nested-lambdas-with-short-syntax/19917720>?
>  It would seem to me that nesting these functions would be a sign you need to 
> refactor anyway. 

Concretely, when you write:

```js
listOfNumbers.map(Math.floor(@) + 1)
```

what does it mean:

```js
_ => listOfNumbers.map(Math.floor(_) + 1) // (1)
listOfNumbers.map(_ => Math.floor(_) + 1) // (2)
listOfNumbers.map(Math.floor(_ => _) + 1) // (3)
```

? Although the most reasonable interpretation for a human would be (2), because 
the parser is unable to read your mind or to make a qualitative distinction 
between `listOfNumbers.map ` and `Math.floor` (both are just functions), it 
will most probably misinterpret it as (3).

That syntax looks like an attractive nuisance to me.

—Claude

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to