Proposing a conditional assignment (or equals) operator

Doug Wade douglas.b.wade at
Tue May 10 04:10:17 UTC 2016

I see this has been discussed on this list a number of times before -- I
found this thread
<>, and
reviewed the linked discussions and previous strawmen (I hope that link is
enough to establish context and why the operator is useful; I can provide
more insight if it would be helpful).  I understand the problem is fraught
and thorny, but I believe the language would greatly benefit from it.

I spent some time reflecting on what I think would be expected of such an
operator (most notably that it be as close to the other assignment
operators +=, -= &c. and the || operator as I could manage, and that it
match the ||= operator in Ruby
closely) and wrote up a quick reference implementation (-ish? see babylon
(parser) <>
 and babel (compiler)
and an set of test cases
<> to match what I
think expresses my thoughts on what I personally would expect from such an
operator more eloquently than I think I could in words (please don't think
me presumptuous; I thought it easier to write out my thoughts in code than
English, not that the debate would be so simple that my implementation
would be rubber stamped).

I have reviewed the process documentation
<> and the contributing guide
<>, and I
believe I am seeking a TC39 champion to make this a stage 0 strawman
proposal, though I will admit that from my review of the archives
<> there is likely to be a lot of discussion before
we reach that point.  Please advise me as to what more I can do to get this
included in the ES standard.

All the best,
Doug Wade
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list