Scala: a way to use a function directly in println (...) using string interpolation
As of Scala 2.10+ String Interpolation can be done. So I have this question. How can you do it:
println(f"$foo(100,51)%1.0f" )
considering foo is a function like:
def foo(x1:Int , x2:Int) : Double = { ... }
From what I understand how this is evaluated, foo is considered to have no arguments since the message I receive is:
missing arguments for method foo in object bar;
follow this method with `_' if you want to treat it as a partially applied function
I tried using parentheses, but errors still happen.
+3
source to share