The only place I remember using this syntax is COBOL, about 25 years ago.
I suspect that the reason it is not widely supported is because it leads to uncertainty that the compiler cannot solve. In your particular case, this is not a special problem, since "this" and "that" are strings for which the conditional OR operator does not make sense. But consider this fragment, in C language, where the conditional result is a Boolean value of 0 or 1:
int a = 22; int b = 99; int rslt = SomeFunction(); if (rslt == (a || b))
At this point, the compiler cannot reliably determine what you want. You intend to do this:
if (rslt == a || rslt == b)
or, did you intend to:
if ((rslt == 0 && a == 0 && b == 0) || (rslt == 1 && a == 1 && b == 1))
You can limit the types for which such syntax can be used, but then you accumulate exceptions instead of what ideally should be orthogonal syntax. This will confuse users and complicate the compiler.
It also forces expressions to be evaluated differently in conditional expressions than in assignment operators. This, of course, will complicate the compiler.
This can certainly be done for the job, but I think it will require a new syntax with overloaded characters and all for dubious benefits.
Jim mischel
source share