Re: Static local variables

2015-08-10 Thread myemailum14
Look at it this way a = a + 1 is same as a += 1 then it feels natural to say the same thing a = a || 1 a ||= 1 then you can extend it like this a ||= var1 || var 2 || var 3 On Mon, Aug 10, 2015 at 12:16 PM, joe joe...@gmail.com wrote: I've been hesitant to bring up this idea, because

Re: please add orEqual operator

2015-08-10 Thread myemailum14
I one day writing js thought why there is no operator for ||= there should be syntax makes sense, then i learned some ruby and it had this already. Now i was convinced it makes sense afterall. On Mon, Aug 10, 2015 at 1:15 PM, joe joe...@gmail.com wrote: I actually like `[1, 2, 3, 4, 5,

Re: Static local variables

2015-08-10 Thread myemailum14
-1 On Mon, Aug 10, 2015 at 2:39 PM, joe joe...@gmail.com wrote: Eek, this is even worse than I though. From the previous discussion: If static means shared per-Function-object or shared per activation of the enclosing scope of the static's scope, we quickly run into weird behavior.

Re: please add x .= f()

2015-08-10 Thread myemailum14
Please no, while i can see how logically it's derived from a = a + 1 a = a.f() a .= f() seems like a bad idea i can hardly see the dot why would i replace the object from which i'm calling the method in most cases looks inefficient On Mon, Aug 10, 2015 at 2:07 PM, Brendan Eich

Re: please add orEqual operator

2015-08-10 Thread myemailum14
Thanks I'll be searching through archive, and yea i think this is something very simple and yet innovative. On Mon, Aug 10, 2015 at 3:55 AM, Peter van der Zee e...@qfox.nl wrote: On Mon, Aug 10, 2015 at 3:50 AM, myemailu...@gmail.com wrote: Isn't prop ||= 0; better than prop = prop ||

please add orEqual operator

2015-08-09 Thread myemailum14
it could be used like this: if ( a == 1 ||= 2 ||=3 ||=5) { //do something if a is either 1,2,3,5} and it could be used like this a || = 0 // a = a || 0 thanks ___ es-discuss mailing list es-discuss@mozilla.org

Re: please add orEqual operator

2015-08-09 Thread myemailum14
why create an array when there can be an operator. I think if we do survey people will like this, ||=, it's more expressive. On Sun, Aug 9, 2015 at 9:41 PM, Isiah Meadows isiahmead...@gmail.com wrote: Or, there is the likely ES7 Array#contains for comparing multiple numbers. ```js [1, 2,

Re: please add orEqual operator

2015-08-09 Thread myemailum14
Isn't prop ||= 0; better than prop = prop || 0; and it can be even defined like this. prop ||= var1 ||= var2 ||= 0; but then i dont know how we can use it ike this if (num == 3 ||=4 ||=6) On Sun, Aug 9, 2015 at 9:47 PM, myemailu...@gmail.com wrote: why create an array when there can be