Skip to content

Commit

Permalink
Merge pull request #2970 from johnduffell/patch-1
Browse files Browse the repository at this point in the history
Clearer points in favour of macro mixing
  • Loading branch information
sjrd authored Feb 14, 2024
2 parents d626b36 + a59ef92 commit 5f18650
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion _overviews/scala3-migration/compatibility-metaprogramming.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ You can learn all the new metaprogramming concepts by reading the [Macros in Sca
## Cross-building a Macro Library

You have written a wonderful macro library and you would like it to be available in Scala 2.13 and Scala 3.
There are two different approaches, the traditional cross-building technique and the more experimental mixing macro technique.
There are two different approaches, the traditional cross-building technique and the more flexible macro mixing technique.

The benefit of macro mixing is that consumers who take advantage of the `-Ytasty-reader` option can still use your macros.

You can learn about them by reading these tutorials:
- [Cross-Building a Macro Library](tutorial-macro-cross-building.html)
- [Mixing Scala 2.13 and Scala 3 Macros](tutorial-macro-mixing.html)
Expand Down
8 changes: 5 additions & 3 deletions _overviews/scala3-migration/tutorial-macro-mixing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ previous-page: tutorial-macro-mixing
next-page: tooling-syntax-rewriting
---

This tutorial shows how to mix Scala 2.13 and Scala 3 macros in a single artifact.
This tutorial shows how to mix Scala 2.13 and Scala 3 macros in a single artifact. This means that consumers can use '-Ytasty-reader' from Scala 2.13 code that uses your macros.

It can be used to create a new Scala 3 macro library and make it available for Scala 2.13 users.
It can also be used to port an existing Scala 2.13 macro library to Scala 3, although it is probably easier to cross-build.
There are two main benefits of this:

1. Making a new or existing scala 3 macro library available for Scala 2.13 users without having to provide a separate 2.13 version
2. Allowing your macros to be usable in multi-project builds that are being upgraded module by module.

## Introduction

Expand Down

0 comments on commit 5f18650

Please sign in to comment.