Re: Object.equals() and Object.clone()

2016-11-14 Thread Kevin Barabash
constructed directly, what happens >> with them? >> - do you copy internal properties? this would make it hard to polyfill >> - how does it behave with getters and setters? >> - with regular expressions do you copy the lastIndex? >> >> Most of those apply to Object.e

Object.equals() and Object.clone()

2016-11-14 Thread Kevin Barabash
It would be nice if deep equality checking and deep cloning of objects was included in the standard library. Has there been any proposals around including these in the past? – Kevin ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla

Re: operator overloading proposal

2016-05-20 Thread Kevin Barabash
a number, "x|0" to an >> 32-bit integer, etc. These kinds of guarantees are what "asm.js" is based >> on, for example, and having to wait until type feedback is available to >> perform its optimizations is likely to be a non-starter. >> >> &g

Re: operator overloading proposal

2016-05-17 Thread Kevin Barabash
erators, the behavior can become visible to previous code if the > other type specified has a static `Symbol.hasInstance` method. > > The reason I provided the `this` alias is for anonymous classes, so you > can create anonymous objects. It's also helpful in case you have a longer >

Re: operator overloading proposal

2016-05-17 Thread Kevin Barabash
It seems like this model can be abused in the same way that having separate methods for assign operators can be abused. I think having separate operators and automatically using `[[plusOp]]` if `[[assignPlusOp]]` doesn't exist is an easier programming model. People who need the extra performance

Re: operator overloading proposal

2016-05-11 Thread Kevin Barabash
ight side has an operator defined, but the left side >>>>> doesn't, and if the operator checked for isn't an assignment one, the >>>>> right >>>>> side's operator is checked and called. Or basically, beyond assignment, >>>>&

Re: operator overloading proposal

2016-05-10 Thread Kevin Barabash
> > > > time whether the object has overloaded operators. It's much simpler >> for >> > > > the engine to figure out, and it's more performant because you only >> need >> > > > to check one thing instead of worrying about

Re: operator overloading proposal

2016-05-09 Thread Kevin Barabash
link? > > It has been mentioned and discussed in numerous places over the years, you > can find more info on this with some casual googling. For example: > https://news.ycombinator.com/item?id=2983420 > > > > On Sun, May 8, 2016 at 2:51 PM, Kevin Barabash > wrote: > &

Re: operator overloading proposal

2016-05-07 Thread Kevin Barabash
s of macros, but last I heard > of it, they say it's going to make its way into the standard pretty soon > (TM), and macros can do much of the things overloading could, and much more. > > On Sun, May 8, 2016 at 8:51 AM, Kevin Barabash > wrote: > >> I forgot to mention in

Re: operator overloading proposal

2016-05-07 Thread Kevin Barabash
I forgot to mention in my last email that I'm looking for a champion for this proposal. On Sat, May 7, 2016 at 5:24 PM, Kevin Barabash wrote: > Hi everyone, > > I've been working on implementing operator overloading and would like to > submit a proposal. > > I thin

operator overloading proposal

2016-05-07 Thread Kevin Barabash
Hi everyone, I've been working on implementing operator overloading and would like to submit a proposal. I think operator overloading would be a useful addition to the language. In particular I think it would be useful for defining operations on common mathematical object types such as complex nu