Skip to content

Commit 8b92994

Browse files
committed
more fixes in Markdown files
1 parent 34064b2 commit 8b92994

File tree

5 files changed

+44
-15
lines changed

5 files changed

+44
-15
lines changed

docs/docs/reference/changed-features/eta-expansion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def next(): T
2828
```
2929

3030
Given a simple reference to `next` does not auto-convert to a function.
31-
One has to write explicitly `() => next()` to achieve that
31+
One has to write explicitly `() => next()` to achieve that.
3232
Once again since the `_` is going to be deprecated it's better to write it this way
3333
rather than `next _`.
3434

docs/docs/reference/dropped-features/limit22.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ The limits of 22 for the maximal number of parameters of function types and the
77
maximal number of fields in tuple types have been dropped.
88

99
* Functions can now have an arbitrary number of parameters. Functions beyond
10-
`Function22` are erased to a new trait `scala.FunctionXXL`
10+
[`scala.Function22`](https://www.scala-lang.org/api/current/scala/Function22.html) are erased to a new trait [`scala.runtime.FunctionXXL`](https://dotty.epfl.ch/api/scala/runtime/FunctionXXL.html).
1111

12-
* Tuples can also have an arbitrary number of fields. Tuples beyond `Tuple22`
13-
are erased to a new trait `scala.TupleXXL`. Furthermore, they support generic
12+
* Tuples can also have an arbitrary number of fields. Tuples beyond [`scala.Tuple22`](https://www.scala-lang.org/api/current/scala/Tuple22.html)
13+
are erased to a new class [`scala.runtime.TupleXXL`](https://dotty.epfl.ch/api/scala/runtime/TupleXXL.html) (which extends the trait [`scala.Product`](https://dotty.epfl.ch/api/scala/Product.html)). Furthermore, they support generic
1414
operation such as concatenation and indexing.
1515

1616
Both of these are implemented using arrays.

docs/docs/reference/dropped-features/xml.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,35 @@ title: "Dropped: XML Literals"
44
---
55

66
XML Literals are still supported, but will be dropped in the near future, to
7-
be replaced with XML string interpolation:
7+
be replaced with [XML string interpolation](https://github.com/lampepfl/xml-interpolator):
8+
89
```scala
9-
xml""" ... """
10+
import dotty.xml.interpolator.*
11+
12+
case class Person(name: String) { override def toString = name }
13+
14+
@main def test: Unit =
15+
val bill = Person("Bill")
16+
val john = Person("John")
17+
val mike = Person("Mike")
18+
val todoList = List(
19+
(bill, john, "Meeting", "Room 203, 11:00am"),
20+
(john, mike, "Holiday", "March 22-24")
21+
)
22+
// XML literals (to be dropped)
23+
val mails1 = for (from, to, heading, body) <- todoList yield
24+
<message>
25+
<from>{from}</from><to>{to}</to>
26+
<heading>{heading}</heading><body>{body}</body>
27+
</message>
28+
println(mails1)
29+
// XML string interpolation
30+
val mails2 = for (from, to, heading, body) <- todoList yield xml"""
31+
<message>
32+
<from>${from}</from><to>${to}</to>
33+
<heading>${heading}</heading><body>${body}</body>
34+
</message>"""
35+
println(mails2)
1036
```
37+
38+
For more information, see the semester project [XML String Interpolator for Dotty](https://infoscience.epfl.ch/record/267527) by Yassin Kammoun (2019).

docs/docs/reference/metaprogramming/inline.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,12 @@ Inline methods can override other non-inline methods. The rules are as follows:
181181

182182
### Relationship to `@inline`
183183

184-
Scala 2 also defines a `@inline` annotation which is used as a hint
185-
for the backend to inline code. The `inline` modifier is a more powerful
186-
option: Expansion is guaranteed instead of best effort,
187-
it happens in the frontend instead of in the backend, and it also applies
188-
to recursive methods.
184+
Scala 2 also defines a `@inline` annotation which is used as a hint for the
185+
backend to inline code. The `inline` modifier is a more powerful option:
186+
187+
- expansion is guaranteed instead of best effort,
188+
- expansion happens in the frontend instead of in the backend and
189+
- expansion also applies to recursive methods.
189190

190191
To cross compile between both Scala 3 and Scala 2, we introduce a new `@forceInline`
191192
annotation which is equivalent to the new `inline` modifier. Note that
@@ -379,7 +380,7 @@ val intTwo: 2 = natTwo
379380

380381
## The `scala.compiletime` Package
381382

382-
The `scala.compiletime` package contains helper definitions that provide support for compile time operations over values. They are described in the following.
383+
The [`scala.compiletime`](https://dotty.epfl.ch/api/scala/compiletime.html) package contains helper definitions that provide support for compile time operations over values. They are described in the following.
383384

384385
### `constValue`, `constValueOpt`, and the `S` combinator
385386

@@ -499,7 +500,7 @@ fail(identity("foo")) // error: failed on: identity("foo")
499500

500501
### The `scala.compiletime.ops` package
501502

502-
The `scala.compiletime.ops` package contains types that provide support for
503+
The [`scala.compiletime.ops`](https://dotty.epfl.ch/api/scala/compiletime/ops.html) package contains types that provide support for
503504
primitive operations on singleton types. For example,
504505
`scala.compiletime.ops.int.*` provides support for multiplying two singleton
505506
`Int` types, and `scala.compiletime.ops.boolean.&&` for the conjunction of two

docs/docs/reference/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: doc-page
33
title: "Overview"
44
---
5-
The forthcoming Scala 3 implements many language changes and improvements over Scala 2.
5+
Scala 3 implements many language changes and improvements over Scala 2.
66
In this reference, we discuss design decisions and present important differences compared to Scala 2.
77

88
## Goals
@@ -18,7 +18,7 @@ The language redesign was guided by three main goals:
1818
- Further improve the consistency and expressiveness of Scala's language constructs.
1919

2020
Corresponding to these goals, the language changes fall into seven categories:
21-
(1) Core constructs to strengthen foundations, (2) simplifications and (3) [restrictions](#restrictions), to make the language easier and safer to use, (4) dropped constructs to make the language smaller and more regular, (5) [changed constructs](#changes) to remove warts, and increase consistency and usability, (6) [new constructs](#new-constructs) to fill gaps and increase expressiveness, (7) a new, principled approach to metaprogramming that replaces [Scala 2 experimental macros](https://docs.scala-lang.org/overviews/macros/overview.html).
21+
(1) Core constructs to strengthen foundations, (2) simplifications and (3) [restrictions](#restrictions), to make the language easier and safer to use, (4) [dropped constructs](#dropped-constructs) to make the language smaller and more regular, (5) [changed constructs](#changes) to remove warts, and increase consistency and usability, (6) [new constructs](#new-constructs) to fill gaps and increase expressiveness, (7) a new, principled approach to metaprogramming that replaces [Scala 2 experimental macros](https://docs.scala-lang.org/overviews/macros/overview.html).
2222

2323
## Essential Foundations
2424

0 commit comments

Comments
 (0)