Skip to content

Commit 32bd13f

Browse files
committed
Remove wrong information related to changes in float tokenisation.
1 parent 37ab41b commit 32bd13f

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

_overviews/tutorials/scala-for-java-programmers.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -167,27 +167,11 @@ arithmetic expression like the following:
167167
consists exclusively of method calls, because it is equivalent to the
168168
following expression, as we saw in the previous section:
169169

170-
(1).+(((2).*(3))./(x))
170+
1.+(2.*(3)./(x))
171171

172172
This also means that `+`, `*`, etc. are valid identifiers
173173
in Scala.
174174

175-
The parentheses around the numbers in the second version are necessary
176-
because Scala's lexer uses a longest match rule for tokens.
177-
Therefore, it would break the following expression:
178-
179-
1.+(2)
180-
181-
into the tokens `1.`, `+`, and `2`. The reason that
182-
this tokenization is chosen is because `1.` is a longer valid
183-
match than `1`. The token `1.` is interpreted as the
184-
literal `1.0`, making it a `Double` rather than an
185-
`Int`. Writing the expression as:
186-
187-
(1).+(2)
188-
189-
prevents `1` from being interpreted as a `Double`.
190-
191175
### Functions are objects
192176

193177
Functions are also

0 commit comments

Comments
 (0)