Any idea why `then` is an infix function but `then...
# language-evolution
k
Any idea why
then
is an infix function but
thenBy
isn't?
🤔 4
e
https://kotlinlang.org/docs/coding-conventions.html#infix-functions
Declare a function as
infix
only when it works on two objects which play a similar role. Good examples:
and
,
to
,
zip
. Bad example:
add
.
Comparator then Comparator
has both objects playing similar roles,
Comparator.thenBy(selector)
does not
k
I see. So Mockk blatantly ignores this guideline with all its infix functions like
every { foo() } returns 0
e
mockk isn't the only DSL that breaks conventions, but stdlib (non-DSL) interfaces do try to promote standard style