lundi 6 novembre 2017

Generate a source code as string for method/function code blocks

I want to convert a Scala code block into text source. for example:

def foo(a: String) = println(a)
//to
"def foo(a: String) = println(a)"

I found a similar conversion in Ruby here. Is there any libraries or way(using reflection) to achieve this in Scala?





Aucun commentaire:

Enregistrer un commentaire