Say you have a function that takes several mullable arguments, and the first thing you do in tue function’s body is return early if one of the arguments is null. So you would have something like
fun someFun(a: A?, b:B?, c:C?, d:D?, e:E?, f:F?){
if( a == null || b == null || c == null || d == null || e == null || f == null) return
//do actual work here
}
Now, in english, this would read as 'if a is null, or b is null, or c is null, or d is null, or e is null, or f is null, then return". However in english we express in a more sccint way, by OR’ing the operands: “If a, b, c, d, e or f are null, then return”. I’d be nice if we could have a counterpart of this in syntax:
fun someFun(a: A?, b:B?, c:C?, d:D?, e:E?, f:F?){
if( (a | b | c | d | e f )== null) return
//do actual work here
}
I use “|” instead of “||” to not make “||” polysemic, since “|” is unused in kotlin (weirdly so, IMHO), but using “||” would be just as good for me.
Of course for completion’s sake, I’d also propose having (a & b & c & d) == e with the intuitive meaning you would expect from it.