Why can't a conditional operator be used as an operator?
I would like to do something like:
boolean isXyz = ...;
...
isXyz ? doXyz() : doAbc();
where doXyzand doAbcreturn invalid.
Note that this is not the same as other operators, for example doXyz () + doAbc () essentially needs doXyz and doAbc to return a number-something to work (or strings for concatenation or something yet, but the point is that + really needs values ββto work).
Is there anything deep or is it just an arbitrary decision.
Note . I came from the Java world, but I would like to know if this is possible in your favorite programming language.