Skip to content

Commit 4b8f227

Browse files
committed
Add a complete description of macros
1 parent c5c5f69 commit 4b8f227

File tree

1 file changed

+4
-3
lines changed
  • docs/docs/reference/dropped-features

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ layout: doc-page
33
title: Dropped: Scala 2 Macros
44
---
55

6-
The previous, experimental macro system has been dropped. Instead,
7-
there is a cleaner, more restricted system based on two complementary
8-
concepts: `inline` and `'{ ... }`/`${ ... }` code generation.
6+
The previous, experimental macro system has been dropped. Instead, there is a cleaner, more restricted system based on two complementary concepts: `inline` and `'{ ... }`/`${ ... }` code generation.
7+
`'{ ... }` delays the compilation of the code and produces an object containing the code, dually `${ ... }` evaluates an expression which produces code and inserts it in the surrounding `${ ... }`.
8+
In this setting, a definition marked as inlined containing a `${ ... }` is a macro, the code inside the `${ ... }` is executed at compile-time and produces code in the form of `'{ ... }`.
9+
Additionally, the contents of code can be inspected and created with a more complex reflection API (TASTy Reflect) as an extension of `'{ ... }`/`${ ... }` framework.
910

1011
* `inline` has been [implemented](../other-new-features/inline.md) in Dotty.
1112
* Quotes `'{ ... }` and splices `${ ... }` has been [implemented](../other-new-features/principled-meta-programming.md) in Dotty.

0 commit comments

Comments
 (0)