also, do `&&` and `||` not have an `operat...
# announcements
f
also, do
&&
and
||
not have an
operator fun
?
k
They shortcircuit and that wouldn't really translate well to an
operator fun
with standard arguments.
I suppose they could do something like
inline operator fun doubleAnd(left: Value, right: () -> Value)
but that's starting to get complicated 🙂
☝🏻 1
f
ok I see
thanks
So this means not every operator is backed by an operator fun?
k
Sure.
f
so what happens to these operators under the hood
the compiler just uses them directly?
k
and
,
or
and
xor
? Yeah, those get converted to the corresponding JVM bytecode without any function calls.
f
I mean the shortcircuit ones
k
The compiler implements the logic for them internally yes, they're hardcoded somewhere.
f
thanks alot
k
Haha
and
,
or
and
xor
that was the wrong thread my bad.
f
but its interesting to know that they dont get called as functions either