Macros ship with the Scala compiler starting from 2.10.0.
To get started:
- Create a dedicated project for your macros, as they must be compiled separately from the rest of the program.
scala-reflect.jarin the macro project.
import scala.language.experimental.macrosin the files where you define macros.
- If in doubt, consult the docs.