I'm porting this from the TypeScript issue tracker, original from:
https://github.com/Microsoft/TypeScript/issues/2319#issue-60851953
Since it's very unlikely that the extension methods will ever be
implemented [in a call-site-rewrite
manner](https://github.com/Microsoft/TypeScript/issues/9#
issue
In ECMAScript's current state, infix operators would likely complicate future
discussions of operator overloading. Before we tackle these problems, I think
it's more convenient to have type annotations first.
On Friday, February 2, 2018 12:55:17 PM CET Thomas Grainger wrote:
> I'm porting this f
As it stands, I'd rather see operator overloading before custom operators.
In order to have decent custom operators, you really have to take into
account the whole grammar, and adding them in a way that's not a blatant
tack on usually involves rethinking the entire grammar. In contrast,
operator ov
How would this affect ASI?
a // no semicolon inserted since '+' is an infix operator
+b
a // semicolon inserted since '!' is not an infix operator
!b
but what about
function '!'(a, b) { ... }
// now '!' is both an infix and a prefix operator
a // is a semicolon i
On Fri, Feb 2, 2018 at 10:58 AM, Mike Samuel wrote:
> How would this affect ASI?
>
> a // no semicolon inserted since '+' is an infix operator
> +b
>
> a // semicolon inserted since '!' is not an infix operator
> !b
>
> but what about
>
> function '!'(a, b) { ... }
> //
How would operator precedence work? Would we be restricted to 2-argument
functions only?
On Fri, Feb 2, 2018 at 5:55 AM, Thomas Grainger wrote:
> I'm porting this from the TypeScript issue tracker, original from:
> https://github.com/Microsoft/TypeScript/issues/2319#issue-60851953
>
> Since it
I don't like the idea of custom operators only because of readability of
code - it can be different for different pieces of code, and so I think it
is a larger surface area for bugs, so I think it would be a net negative.
However, I do like the idea of allowing e.g. `+` to be used intuitively and
People in the C++ community have been using overloaded operators since the
1980's, and I wouldn't say that different semantics for the same operator have
been a bad idea at all, given that the operator handles completely different
types (that can and should be statically analyzable).
I wouldn't
Time to put infix operators into TypeScript, first, then?
On Sat, 3 Feb 2018 at 04:25, kdex wrote:
> People in the C++ community have been using overloaded operators since the
> 1980's, and I wouldn't say that different semantics for the same operator
> have
> been a bad idea at all, given that
As stated in here, the TypeScript team is highly unlikely to deviate from
ECMAScript’s team decisions, so I guess no infix functions in TS for now...
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
10 matches
Mail list logo