Suffix/infix notation for properties


#1

Any chance we can get a suffix/infix notation for member/extension properties? e.g.:

suffix val Int.seconds: Duration
    get() = Duration.ofSeconds(toLong())

So that instead of

val duration = 12.seconds

we can write

val duration = 12 seconds

and instead of

val duration = ((-12).seconds).abs()

we can write

val duration = -12 seconds abs()

#2

We have no such plans. The parsing ambiguities seem to be scary.


#3

Suffix notation has been deprecated in Scala because of the parsing ambiguities.


#4

Yes, I guess I was wondering if the fact that it is a property and not a function means that the ambiguities are fewer/non-existent but it does not appear so. Thanks.