If you add infix
to a qualifying function declaration, you can use it via infix
notation, where you skip the parentheses for the parameter to the call and skip
the dot to indicate the receiver of the call. Instead, the function name is simply
bracketed by spaces, causing it to look like an operator.
To qualify, the function:
Must have exactly one parameter (including no varargs and no default values)
Must be on an ordinary object, directly or via an extension function (e.g., no top-level functions)
You can learn more about this in:
Tags: