I wrote a Scala macro to add a function to companion objects for annotated case classes. It was the first macro I’d written, and I learned a lot! Here are some tips and tricks that I think others would also find useful. You’ll learn about what a macro does, how to pattern match with quasiquotes, when macros are expanded, things a macro can’t do at compile time, and helpful debugging tips.
Session length
40 minutes
Language of the presentation
English
Target audience
Intermediate: Requires a basic knowledge of the area
Who is your session intended to
People who know a lot about Scala macros and want to see where documentation and APIs can be improved for newcomers
People who want to write libraries to transform code, and would like to know if macros are a good solution
People who would like to avoid common mistakes when writing a macro