Proposal: Scala macros #3729
Unanswered
darrenoakey
asked this question in
Language Ideas
Replies: 1 comment
-
While I am a huge fan of Scala, and think that more languages should steal from it, and I am a huge fan of macros, and think that more languages should have them, and I believe that Scala has tremendously advanced the state-of-the-art in statically-typed rich-syntax macros, the fact that macros were removed from the language, and re-introduced in an incompatible manner, in almost every major release over the last years, shows us that the state-of-the-art probably still needs some more advancing. If you are advocating for "Scala macros", you at least should say which ones, since they have been re-designed multiple times. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Just want something exactly the same as Scala macros - that allows you to change the ast at compile time. For example, if I could create a base class "Boring" such that if I did this:
it would
or I could create something like Cloneable
which would add a clone method, which would rewrite the constructor and store any constructor parameters that aren't passed in, and then just call the constructor again with the same parameters
or I could create something like Locked
which would have an internal object _lockObject, and rewrite each of the methods as if I put lock (_lockObject) around the method body.
so far I haven't really found anything I wanted to do that I couldn't do in Scala macros - it somewhat obviates the need for a weaver.
Beta Was this translation helpful? Give feedback.
All reactions