Hi All,I have a scenario where my macro has generated a value. Lets say its a Map. I want the literal map to be transformed into an AST for insertion into the generated code. Is there an easy way to do this with QuasiQuotes?
E.g.In macro...val map : Map[String, Int] = someFunctionThatGeneratesAMap(context)val tree : c.Tree = toTree(map) // returns something like: q"map("the" -> 0, "answer" -> 42)"
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Great to hear about Liftable. I could have used it some time ago...
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-languag...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
implicit def `List is liftable`[A: Liftable] = new Liftable[List[A]] {
--
--
I believe this could be of interest to you: https://github.com/scala/scala/pull/3326
It looks like this implicit picks itself inside the quasiquote, because quasiquotes see ..$ and that somehow triggers a lookup for List[A]. Denys could provide the ultimate reference here, but I think we should just wait until 2.11 quasiquotes are backported to 2.10 paradise (because there was a number of changes to lifting recently) and maybe then the problem will fix itself.
--
--
--