Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View join.scala
1 2 3 4 5 6 7 8 9 10 11
import scala.reflect.makro.Context
 
object Macros {
def join_impl(c: Context)(a: c.Tree): c.Tree = {
import c.universe._
import definitions._
val q"{ ..$stats }" = a
stats.foldRight(q"$NilModule") { (el, acc) => q"$acc :: $el" }
}
def join(a: Int): List[Int] = macro join_impl
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.