trait
BlackboxMacro extends AnyRef
Concrete Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
def
+(other: String): String
-
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
-
-
def
ensuring(cond: Boolean, msg: ⇒ Any): BlackboxMacro
-
def
ensuring(cond: Boolean): BlackboxMacro
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
def
formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
EXPERIMENTAL
Traditionally macro implementations are defined as methods, but this trait provides an alternative way of encoding macro impls as bundles, traits which extend
scala.reflect.macros.BlackboxMacro
orscala.reflect.macros.WhiteboxMacro
.Instead of:
def impl[T: c.WeakTypeTag](c: BlackboxContext)(x: c.Expr[Int]) = ...
One can write:
trait Impl extends BlackboxMacro { def apply[T: c.WeakTypeTag](x: c.Expr[Int]) = ... }
Without changing anything else at all.
This language feature is useful in itself in cases when macro implementations are complex and need to be modularized. State of the art technique of addressing this need is quite heavyweight: http://docs.scala-lang.org/overviews/macros/overview.html#writing_bigger_macros.
scala.reflect.macros.WhiteboxMacro