I have a scenario where I have an anonymous function stored in a var
val x = Integer.max _
and I want to do some logic like
if(x == Integer.max _){
println("Using the max function")
}
But I've noticed that these anonymous functions never equal each other.
val x = Integer.max _
val y = Integer.max _
println(x==y) //false
println(x eq y) //false
So is there anyway I can check what anonymous function I have; and if I can't what's the best way to mimic this functionality?