Suffix notation

This is an old thread and I would wager there isn’t much to new that would help suffix style function calls get over the minus 100 points.

They add a lot of potential for confusion when the current options with extensions and operator overriding are so effective for use cases of units. If there is a way to avoid adding the language feature but still get the kind of expressiveness for units then that would be preferred.

Here’s two libraries that give an idea of what’s possible to express now:

There’s also some unit discussion in other topics.
https://discuss.kotlinlang.org/t/units-of-measure/

There’s also the option for units to use some kind of compiler plugin. Compiler plugins have become supported in Kotlin since that discussion. Here’s a link to some stuff mentioned in the discussion:

1 Like