scala parse a string into a Tree to use in a quasi quote

359 views Asked by At

I was wondering if i could perform a sort of a nested quasi quote evaluation.

Let's say i have a function call

q"${function(args)}"

That returns "add(x,y)" (a string)

How can i make it evaluate this?

Something like

val a = q"""${q"${function(args)}"}"""

The problem here is that the first evaluation of the quasi quote is return a String which than leads to nothing being performed in the second evaluation.

0

There are 0 answers