June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
11
Task/Metaprogramming/Scala/metaprogramming.scala
Normal file
11
Task/Metaprogramming/Scala/metaprogramming.scala
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import scala.language.experimental.macros
|
||||
import scala.reflect.macros.Context
|
||||
|
||||
object Macros {
|
||||
def impl(c: Context) = {
|
||||
import c.universe._
|
||||
c.Expr[Unit](q"""println("Hello World")""")
|
||||
}
|
||||
|
||||
def hello: Unit = macro impl
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue