Macros ship with the Scala compiler starting from 2.10.0.
To get started:
- Create a separate project for your macros.
- Reference
scala-reflect.jarin the macro project. - Use
import language.experimental.macrosin the files where you define macros. - If in doubt, consult the docs.
Macros are also in active development within so-called macro paradise, an experimental branch in the official Scala repository. Follow instructions at http://docs.scala-lang.org/overviews/macros/paradise.html to download and use our nightly builds.