Swift style syntax
dawidmj.szlachta at gmail.com
Wed Oct 14 10:50:10 UTC 2015
Maybe it could be possible to allow operator-like characters to be included
in the methods names? Like:
It seems clear and readable. I believe it could be parsed easily, too.
Transpilers could just change it to Math['>'].
Or, maybe allow to use some kind of new syntax (easy to parse for
transpilers), to explicitly inform the parser we want to use operator as a
I think both propositions fix the problem Waldemar mentioned.
2015-10-13 21:56 GMT+02:00 Waldemar Horwat <waldemar at google.com>:
> On 10/13/2015 10:27, Isiah Meadows wrote:
>> Steve, I have little problem with whatever ends up the case, as long as
>> it's shorter than `(x, y) => x + y`. The current idea was inspired by
>> Swift's `list.sort(>)` and `list.reduce(0, +)`.
> I second the concern with this being far too full of hazards to carry its
> weight. Let's say you allow something like the list.reduce(0, +) syntax
> for the various arithmetic operators. Then we get to the fun ones:
> list.reduce(0, /) /x
> Oops, you've just started a regular expression.
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss