Well, I'm moderately sure it will never be added to the language, so I'm not too worried if there does turn out to be some problem I overlooked. :-)
But for the issues you raised:
Lone Chaining Operator
x ||=== "bar"; //syntax error
A chaining operator without a chain is technically a meaningless "either" operator in an incomplete "either / or" statement. (What would it do? Would it only test equality? ) But strictly, it should be forbidden. It would be confusing.
Context Dependency
This breaks my model of what operators do, which expects context-freedom
I understand that a lone chaining operator would be confusing, but I am not sure I understood your point about context-dependency. Here's my best answer, so please excuse me if it is unrelated:
Yes, the proposed operator's behavior is contextual to the expression.
Conditional operators' evaluations are inherently contextual to their expressions, for example:
let x = true && ... && true || false && true ... && someFunc();
Where ...
represents a hidden part of the expression.
Is x
true? Does someFunc()
ever evaluate? Unknowable.
Conditional operators remain expression-context-dependent in this proposal. (Not 100% sure that's what you meant though.)
Array-Like Alternatives
I suspect the same goals could be achieved with sets and ranges. something like
I've answered this a few times, but I know the thread's too long to read. Here's the recap.
This is impossible with set- and range-based approaches:
if( x &&>= rect.left &&<= rect.right ) {
...
}
In principle, all expressions like this one are impossible with sets, ranges, arrays, and functions. (The array functions for()
, reduce()
, some()
, and every()
cannot do it. No functional programming approach can.)
__
Honestly, I wrote this proposal a long time ago, and I feel less than familiar with the reasons behind it these days.
I do remember having very clear reasons for a great many decisions. They might come back to me with questions like yours. Most of those answers are probably covered in the pages here as well.
I think these operators would be useful, and I think people would use them; but of course, not everyone would. I don't use classes, for example, and I know many coders use classes for everything.
In any case, thank you for taking the time to read and react. :-)