Using Scala macros I would like to get access to source code of function f.
Here is simplified example of my problem:
def logFImplementation(f: => Boolean) {
val sourceCodeOfF: String = ... // <-- how to get source code of f??
println("Scala source of f=" + sourceCodeOfF)
}
so for:
logFImplementation { val i = 5; List(1, 2, 3); true }
it should print:
Scala source of f=val i: Int = 5; immutable.this.List.apply[Int](1, 2, 3); true
(Right now I tested Macro to access source code text at runtime and it works great for { val i = 5; List(1, 2, 3); true }.logValueImpl
but for f.logValueImpl
it just prints f
.)
Thanks for any advice.