I’m curious how to programmatically print the function summary that REPL outputs, i.e.
myFunction doStatic (generic function with 3 methods)
For instance, I’d like to be able to do the following:
function myFunction(a::Int32,b::Int32)
c = (1 + a) ^ b
return c
end
function myFunction(a::Int32,b::Float64)
c = (1 + a) ^ Int32(floor(b))
return c
end
function myFunction(a::Float64,b::Float64)
c = (1 + a) ^ b
return c
end
whatFunction(myFunction)
whatFunction(+)
whatFunction(kron)
and have the following print to the REPL / terminal / notebook:
myFunction (generic function with 3 methods)
+ (generic function with 163 methods)
kron (generic function with 18 methods)
I realize I could write my own function to do this (pull from methods()
), but I wanted to check first that I wasn’t missing a built-in. I’ve looked through show
, dump
, println
… I’ve not found anything that replicates the REPL output.