Comma inference

I know about trailing commas, but find them somewhat unesthetic. Now and then I have to copy sequences of vals into parameters which needs insertion of all these commas.

Yes, you are right “comma inference” would interfere with operation notation where dots can be omitted. For this means “semicolon inference” states some rules when not to infere a semicolon (cited from “Programming Scala”; Odersky et. al):

(1) The line in question ends in a word that would not be legal as the end of a s statement, such as period or an infix operator.

(2) The next line begins with a word that cannot start a statement.

(3) not applicable here

Rules (1) and (2) could also be used for “comma inference”.

1 Like