Skip to content

document migration of macros that require fresh names #12960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cchantep opened this issue Jun 27, 2021 · 8 comments
Open

document migration of macros that require fresh names #12960

cchantep opened this issue Jun 27, 2021 · 8 comments
Assignees
Labels

Comments

@cchantep
Copy link
Contributor

Scala 2 Macro freshName has no equivalent in new meta-programming API.

@bishabosha
Copy link
Member

All names you give will be automatically made fresh in scope, do you have an example where something breaks because of this expectation?

@cchantep
Copy link
Contributor Author

Then it's important to clearly state that point in the migration guide. I haven't personally seen anything about (neither in the source quote).

@nicolasstucki
Copy link
Contributor

Technically we do not support the fresh name concept as this is part of syntactic macros that scala 3 does not support (such as in re-typethinking).

We only support semantic macros where names are themself semantic (i.e. symbol). These names do not need to be refreshed as conflicts are not possible. In Scala 3 once you created a name for a definition, it is guaranteed to not have conflicts. Internally there are some renaming that happens for local variables to make it possible to distinguish different names.

We need a migration example with some code that requires re-typechecking and fresh names.

@bishabosha bishabosha changed the title No way to generate a fresh name in macro document migration of macros that require fresh names Aug 23, 2021
@nicolasstucki nicolasstucki added area:metaprogramming:reflection Issues related to the quotes reflection API and removed area:metaprogramming labels Jun 2, 2022
@ValeriePe
Copy link

This issue was picked for the Issue Spree 18 of July 5th which takes place in a week from now. @EstebanMarin @anatoliykmetyuk will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.

@ValeriePe
Copy link

ValeriePe commented Aug 8, 2022

This issue was picked for the Issue Spree n° 19 of August 16th which takes place in a week from now. @tgodzik @gagandeepkalra @jackcviers will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.

@tgodzik
Copy link
Contributor

tgodzik commented Aug 16, 2022

I might not be able to join unfortunately today. 😓 I am curious though what was the result of the previous spree @anatoliykmetyuk ?

@EstebanMarin
Copy link
Contributor

Hello everyone. @tgodzik @anatoliykmetyuk In the previous meetings we had on this, the idea was simple. Is to start a scala 3 seed: https://index.scala-lang.org/regadas/scala-seed and ensure the code of the macros https://docs.scala-lang.org/scala3/guides/macros/ tutorial runs.
Once that is checked then the next step is to then fill the missing parts of the documentation https://docs.scala-lang.org/scala3/guides/macros/compiletime.html => in the values, testing, assertions

@cchantep
Copy link
Contributor Author

The tutorial doesn't indicate that unlike Scala 2 macro there is no need to do anything special to have fresh term name, so that's different issue.

@mbovel mbovel removed the Spree Suitable for a future Spree label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants