You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a more detailed discussion on the transition to Scala 3 you can read the
42
+
[Scala 2 roadmap update: The road to Scala 3](https://www.scala-lang.org/2019/12/18/road-to-scala-3.html).
43
+
32
44
### Community-build
33
45
34
-
Feature Freeze (FF) doesn't mean that development slows down. On the contrary!
35
-
FF means that we can now put the Scala 3 compiler under heavy load, getting it
46
+
Being feature complete doesn't mean that development slows down. On the contrary!
47
+
It means that we can now put the Scala 3 compiler under heavy load, getting it
36
48
ready for industrial strength applications. At the moment we have 23
37
49
projects on our community projects and we expect this number to go up!
38
50
@@ -47,7 +59,7 @@ from the root of the dotty repo.
47
59
48
60
### New Issues
49
61
50
-
Firstly thank you for all the hard work in issue reporting! FF means that our
62
+
Firstly thank you for all the hard work in issue reporting! Being feature complete means that our
51
63
issue tracker will now be more important than ever. We encourage you to stress
52
64
the compiler and report self contained test-cases! Bug minimization is hard and
53
65
a form of art! Help us unearth those nasty bugs! ✊
@@ -238,16 +250,23 @@ You can read more on our docs [Match Expressions](https://dotty.epfl.ch/docs/ref
238
250
## New quoted pattern matching
239
251
240
252
We introduce a high-level API to deconstruct or extract values out of `Expr`
241
-
using pattern matching. It consists of quoted patterns that allows to
242
-
deconstruct complex code that contains a precise structure, types or methods.
253
+
using pattern matching. It consists of high-level extractors for getting static
254
+
information out of exprs and, of quoted patterns that allows to deconstruct
255
+
complex code that contains a precise structure, types or methods.
243
256
Patterns `'{ ... }` can be placed in any location where Scala expects a pattern.
244
257
245
-
For example, the following snippet implements a simple, 1-level, non-recursive
246
-
rewriter macro for exponents. `rewrite` is a an inline method definition
247
-
designating a macro. To inspect an `expr` value we can now use the quoted syntax
248
-
as patterns inside a match expression. Notice that quotes designate patterns and
249
-
`$`, the familiar syntax for splices is used to _extract_ (capture) information
250
-
out of a pattern.
258
+
The new extractors are summarized below:
259
+
260
+
*`scala.quoted.matching.Const`: matches an expression a literal value and returns the value.
261
+
*`scala.quoted.matching.ExprSeq`: matches an explicit sequence of expresions and returns them. These sequences are useful to get individual `Expr[T]` out of a varargs expression of type `Expr[Seq[T]]`.
262
+
*`scala.quoted.matching.ConstSeq`: matches an explicit sequence of literal values and returns them.
263
+
264
+
The following snippet demonstrates the new _quoted patterns_ implementing a
265
+
simple, 1-level, non-recursive rewriter macro for exponents. `rewrite` is a an
266
+
inline method definition designating a macro as usual. To inspect an `expr`
267
+
value with friendly syntax we can now use the quoted syntax as patterns inside a
268
+
match expression. Notice that quotes designate patterns and `$`, the familiar
269
+
syntax for splices is used to _extract_ (capture) information out of a pattern.
Additionally to the quoted patterns we provide extractors in
273
-
`scala.quoted.matching` that extract static information from `Expr`s. Namely
274
-
`Const`, `ExprSeq` and `ConstSeq`.
275
-
276
291
To learn more read our docs on [pattern matching over quotes](https://dotty.epfl.ch/docs/reference/metaprogramming/macros.html#pattern-matching-on-quoted-expressions).
277
292
278
293
## Added support for SemanticDB extraction
279
294
280
-
Scala 3 now offers support for SemanticDB extraction producing `.semanticdb` files.
281
-
Users can use the `-Ysemanticdb` compiler flag to enable exporting SemanticDB files. Providing `-semanticdb-target` allows the user to select a separate target destination for the `META-INF` directory that stores SemanticDB files and `-sourceroot` to calculate a relative path for SemanticDB files within `META-INF`
282
-
295
+
Scala 3 now offers support for SemanticDB extraction producing `.semanticdb`
296
+
files. Users can use the `-Ysemanticdb` compiler flag to enable exporting
297
+
SemanticDB files. Providing `-semanticdb-target` allows the user to select a
298
+
separate target destination for the `META-INF` directory that stores SemanticDB
299
+
files and `-sourceroot` to calculate a relative path for SemanticDB files within
0 commit comments