As Alexiv points out, the problem is that you cannot place a binary operator after using postfix syntax for the unary operator. There are multiple problems with postfix syntax, which is why Scala 2.10 will warn you unless you enable a special language feature.
So in theory 7.? & 10.?
should work. But now you run into a problem of ambiguity between integer and floating point literals. From the Scala Language Specification §1.3.2 "Floating Point Literals":
If a floating point literal in a program is followed by a token starting with a letter, there must be at least one intervening whitespace character between the two tokens.
So the rules are defined the opposite way here, i.e. Scala seems to assume a floating point number first and integer second. 7.?
would be interpreted as a method on a Double
, whereas 7.x
is a method on Int
, and if you want that on Double
, you would have to write 7. x
.
No how to do the opposite? Place a space before the period:
7 .? & 10 .?
... which of course makes it as long as using parentheses
(7?) & (10?)
So you don't get your 6 characters, but then why do need it that short?